2024-10-20 14:00:56 -05:00
|
|
|
fib:
|
2024-11-17 03:06:10 -06:00
|
|
|
ADDI64 r254, r254, -32d
|
|
|
|
ST r31, r254, 0a, 32h
|
2024-10-20 14:00:56 -05:00
|
|
|
CP r32, r2
|
|
|
|
LI64 r33, 2d
|
2024-11-15 15:35:03 -06:00
|
|
|
JLTU r32, r33, :0
|
|
|
|
ADDI64 r34, r32, -1d
|
|
|
|
CP r2, r34
|
2024-10-20 14:00:56 -05:00
|
|
|
JAL r31, r0, :fib
|
|
|
|
CP r34, r1
|
2024-11-15 15:35:03 -06:00
|
|
|
SUB64 r32, r32, r33
|
|
|
|
CP r2, r32
|
2024-10-20 14:00:56 -05:00
|
|
|
JAL r31, r0, :fib
|
2024-11-15 15:35:03 -06:00
|
|
|
CP r32, r1
|
|
|
|
ADD64 r32, r32, r34
|
|
|
|
CP r1, r32
|
2024-10-20 14:00:56 -05:00
|
|
|
JMP :1
|
|
|
|
0: CP r1, r32
|
2024-11-17 03:06:10 -06:00
|
|
|
1: LD r31, r254, 0a, 32h
|
|
|
|
ADDI64 r254, r254, 32d
|
2024-10-20 14:00:56 -05:00
|
|
|
JALA r0, r31, 0a
|
|
|
|
fib_iter:
|
2024-11-15 15:35:03 -06:00
|
|
|
CP r13, r2
|
|
|
|
LI64 r17, 1d
|
|
|
|
CP r15, r0
|
|
|
|
CP r16, r17
|
|
|
|
CP r14, r15
|
|
|
|
2: JNE r13, r15, :0
|
|
|
|
CP r1, r14
|
2024-10-20 14:00:56 -05:00
|
|
|
JMP :1
|
2024-11-15 15:35:03 -06:00
|
|
|
0: ADD64 r14, r16, r14
|
|
|
|
SUB64 r13, r13, r17
|
|
|
|
SWA r14, r16
|
2024-10-20 14:00:56 -05:00
|
|
|
JMP :2
|
2024-11-17 03:06:10 -06:00
|
|
|
1: JALA r0, r31, 0a
|
2024-10-20 14:00:56 -05:00
|
|
|
main:
|
2024-11-17 03:06:10 -06:00
|
|
|
ADDI64 r254, r254, -24d
|
|
|
|
ST r31, r254, 0a, 24h
|
2024-10-29 04:31:52 -05:00
|
|
|
LI64 r32, 10d
|
|
|
|
CP r2, r32
|
2024-10-20 14:00:56 -05:00
|
|
|
JAL r31, r0, :fib
|
2024-10-29 04:31:52 -05:00
|
|
|
CP r33, r1
|
2024-11-15 15:35:03 -06:00
|
|
|
CP r2, r32
|
2024-10-20 14:00:56 -05:00
|
|
|
JAL r31, r0, :fib_iter
|
2024-11-15 15:35:03 -06:00
|
|
|
CP r32, r1
|
|
|
|
SUB64 r32, r33, r32
|
|
|
|
CP r1, r32
|
2024-11-17 03:06:10 -06:00
|
|
|
LD r31, r254, 0a, 24h
|
|
|
|
ADDI64 r254, r254, 24d
|
2024-10-20 14:00:56 -05:00
|
|
|
JALA r0, r31, 0a
|
2024-11-17 03:06:10 -06:00
|
|
|
code size: 305
|
2024-10-20 14:00:56 -05:00
|
|
|
ret: 0
|
|
|
|
status: Ok(())
|