forked from AbleOS/holey-bytes
82 lines
1.7 KiB
Plaintext
82 lines
1.7 KiB
Plaintext
do_stuff:
|
|
ADDI64 r254, r254, -8d
|
|
ST r32, r254, 0a, 8h
|
|
CP r13, r2
|
|
CP r1, r13
|
|
LD r32, r254, 0a, 8h
|
|
ADDI64 r254, r254, 8d
|
|
JALA r0, r31, 0a
|
|
just_read:
|
|
CP r0, r2
|
|
JALA r0, r31, 0a
|
|
main:
|
|
ADDI64 r254, r254, -88d
|
|
ST r31, r254, 48a, 40h
|
|
ADDI64 r32, r254, 16d
|
|
CP r1, r32
|
|
JAL r31, r0, :optionala
|
|
LD r33, r254, 16a, 8h
|
|
JNE r33, r0, :0
|
|
LI64 r32, 10d
|
|
CP r1, r32
|
|
JMP :1
|
|
0: ST r0, r254, 24a, 8h
|
|
CP r2, r32
|
|
JAL r31, r0, :just_read
|
|
LD r32, r254, 24a, 8h
|
|
CP r2, r32
|
|
JAL r31, r0, :do_stuff
|
|
CP r32, r1
|
|
ADDI64 r33, r254, 0d
|
|
CP r1, r33
|
|
JAL r31, r0, :optional
|
|
ST r1, r33, 0a, 16h
|
|
LD r33, r254, 0a, 1h
|
|
ANDI r33, r33, 255d
|
|
JNE r33, r0, :2
|
|
LI64 r32, 20d
|
|
CP r1, r32
|
|
JMP :1
|
|
2: LI64 r33, 100d
|
|
CP r2, r33
|
|
JAL r31, r0, :do_stuff
|
|
CP r33, r1
|
|
ADD64 r32, r33, r32
|
|
CP r1, r32
|
|
1: LD r31, r254, 48a, 40h
|
|
ADDI64 r254, r254, 88d
|
|
JALA r0, r31, 0a
|
|
optional:
|
|
ADDI64 r254, r254, -32d
|
|
ST r32, r254, 16a, 16h
|
|
LI8 r13, 1b
|
|
ADDI64 r14, r254, 0d
|
|
ST r13, r254, 0a, 1h
|
|
LI64 r13, 10d
|
|
ST r13, r254, 8a, 8h
|
|
LD r1, r14, 0a, 16h
|
|
LD r32, r254, 16a, 16h
|
|
ADDI64 r254, r254, 32d
|
|
JALA r0, r31, 0a
|
|
optionala:
|
|
ADDI64 r254, r254, -80d
|
|
ST r32, r254, 48a, 32h
|
|
CP r17, r1
|
|
ADDI64 r14, r254, 8d
|
|
ADDI64 r15, r254, 16d
|
|
ST r14, r254, 16a, 8h
|
|
LI64 r16, 1d
|
|
ST r16, r254, 24a, 8h
|
|
ADDI64 r13, r254, 0d
|
|
ST r13, r254, 32a, 8h
|
|
ST r0, r254, 0a, 8h
|
|
ST r0, r254, 8a, 8h
|
|
ST r0, r254, 40a, 8h
|
|
BMC r15, r17, 32h
|
|
LD r32, r254, 48a, 32h
|
|
ADDI64 r254, r254, 80d
|
|
JALA r0, r31, 0a
|
|
code size: 673
|
|
ret: 100
|
|
status: Ok(())
|