holey-bytes/lang/tests/son_tests_if_statements.txt
2024-10-24 09:43:07 +02:00

32 lines
587 B
Plaintext

fib:
ADDI64 r254, r254, -32d
ST r31, r254, 0a, 32h
LI64 r1, 1d
LI64 r32, 2d
JGTS r2, r32, :0
JMP :1
0: CP r6, r2
SUB64 r2, r6, r1
CP r33, r6
JAL r31, r0, :fib
CP r2, r33
CP r34, r1
SUB64 r2, r2, r32
JAL r31, r0, :fib
CP r8, r34
ADD64 r1, r1, r8
1: LD r31, r254, 0a, 32h
ADDI64 r254, r254, 32d
JALA r0, r31, 0a
main:
ADDI64 r254, r254, -8d
ST r31, r254, 0a, 8h
LI64 r2, 10d
JAL r31, r0, :fib
LD r31, r254, 0a, 8h
ADDI64 r254, r254, 8d
JALA r0, r31, 0a
code size: 214
ret: 55
status: Ok(())