2024-10-20 14:00:56 -05:00
|
|
|
fib:
|
|
|
|
ADDI64 r254, r254, -32d
|
|
|
|
ST r31, r254, 0a, 32h
|
|
|
|
CP r32, r2
|
|
|
|
LI64 r33, 2d
|
2024-10-25 07:51:33 -05:00
|
|
|
JLTU r2, r33, :0
|
2024-10-24 02:43:07 -05:00
|
|
|
CP r6, r32
|
|
|
|
ADDI64 r2, r6, -1d
|
2024-10-20 14:00:56 -05:00
|
|
|
JAL r31, r0, :fib
|
|
|
|
CP r2, r32
|
|
|
|
CP r34, r1
|
|
|
|
SUB64 r2, r2, r33
|
|
|
|
JAL r31, r0, :fib
|
2024-10-24 02:43:07 -05:00
|
|
|
CP r6, r34
|
|
|
|
ADD64 r1, r1, r6
|
2024-10-20 14:00:56 -05:00
|
|
|
JMP :1
|
|
|
|
0: CP r1, r32
|
|
|
|
1: LD r31, r254, 0a, 32h
|
|
|
|
ADDI64 r254, r254, 32d
|
|
|
|
JALA r0, r31, 0a
|
|
|
|
fib_iter:
|
|
|
|
LI64 r4, 1d
|
|
|
|
LI64 r5, 0d
|
|
|
|
CP r1, r5
|
|
|
|
CP r10, r4
|
|
|
|
2: JNE r2, r5, :0
|
|
|
|
JMP :1
|
2024-10-27 07:57:00 -05:00
|
|
|
0: ADD64 r1, r10, r1
|
2024-10-20 14:00:56 -05:00
|
|
|
SUB64 r2, r2, r4
|
2024-10-27 07:57:00 -05:00
|
|
|
CP r3, r1
|
2024-10-20 14:00:56 -05:00
|
|
|
CP r1, r10
|
|
|
|
CP r10, r3
|
|
|
|
JMP :2
|
|
|
|
1: JALA r0, r31, 0a
|
|
|
|
main:
|
2024-10-27 13:13:25 -05:00
|
|
|
ADDI64 r254, r254, -18d
|
|
|
|
ST r31, r254, 2a, 16h
|
|
|
|
LI8 r1, 10b
|
|
|
|
ST r1, r254, 0a, 1h
|
|
|
|
ST r1, r254, 1a, 1h
|
2024-10-26 05:48:57 -05:00
|
|
|
LD r5, r254, 0a, 1h
|
|
|
|
ANDI r2, r5, 255d
|
2024-10-20 14:00:56 -05:00
|
|
|
JAL r31, r0, :fib
|
2024-10-27 13:13:25 -05:00
|
|
|
CP r32, r1
|
|
|
|
LI64 r2, 10d
|
2024-10-20 14:00:56 -05:00
|
|
|
JAL r31, r0, :fib_iter
|
2024-10-27 13:13:25 -05:00
|
|
|
CP r4, r32
|
2024-10-26 05:48:57 -05:00
|
|
|
SUB64 r1, r4, r1
|
2024-10-27 13:13:25 -05:00
|
|
|
LD r31, r254, 2a, 16h
|
|
|
|
ADDI64 r254, r254, 18d
|
2024-10-20 14:00:56 -05:00
|
|
|
JALA r0, r31, 0a
|
2024-10-27 13:13:25 -05:00
|
|
|
code size: 353
|
2024-10-20 14:00:56 -05:00
|
|
|
ret: 0
|
|
|
|
status: Ok(())
|