35 lines
574 B
Plaintext
35 lines
574 B
Plaintext
inb:
|
|
CP r13, r2
|
|
CP r1, r13
|
|
JALA r0, r31, 0a
|
|
main:
|
|
ADDI64 r254, r254, -24d
|
|
ST r31, r254, 0a, 24h
|
|
LI64 r32, 100d
|
|
4: CP r2, r32
|
|
JAL r31, r0, :inb
|
|
CP r33, r1
|
|
ANDI r33, r33, 2d
|
|
JNE r33, r0, :0
|
|
LI64 r33, 96d
|
|
CP r2, r33
|
|
CP r3, r0
|
|
JAL r31, r0, :outb
|
|
3: CP r2, r32
|
|
JAL r31, r0, :inb
|
|
CP r33, r1
|
|
JEQ r33, r0, :1
|
|
LI64 r32, 1d
|
|
CP r1, r32
|
|
JMP :2
|
|
1: JMP :3
|
|
0: JMP :4
|
|
2: LD r31, r254, 0a, 24h
|
|
ADDI64 r254, r254, 24d
|
|
JALA r0, r31, 0a
|
|
outb:
|
|
JALA r0, r31, 0a
|
|
code size: 203
|
|
ret: 1
|
|
status: Ok(())
|