forked from koniifer/ableos
71 lines
1.3 KiB
Plaintext
71 lines
1.3 KiB
Plaintext
main:
|
|
ADDI64 r254, r254, -26d
|
|
ST r31, r254, 2a, 24h
|
|
LI64 r32, 10d
|
|
ST r32, r254, 0a, 1h
|
|
LI64 r32, 10d
|
|
ST r32, r254, 1a, 1h
|
|
CP r32, r0
|
|
LD r32, r254, 0a, 1h
|
|
CP r33, r0
|
|
LD r33, r254, 1a, 1h
|
|
CP r2, r32
|
|
JAL r31, r0, :fib
|
|
CP r32, r1
|
|
CP r2, r33
|
|
JAL r31, r0, :fib_iter
|
|
CP r33, r1
|
|
SUB64 r32, r32, r33
|
|
CP r1, r32
|
|
LD r31, r254, 2a, 24h
|
|
ADDI64 r254, r254, 26d
|
|
JALA r0, r31, 0a
|
|
fib_iter:
|
|
ADDI64 r254, r254, -48d
|
|
ST r31, r254, 0a, 48h
|
|
CP r32, r2
|
|
LI64 r33, 0d
|
|
LI64 r34, 1d
|
|
2: LI64 r35, 0d
|
|
JNE r32, r35, :0
|
|
JMP :1
|
|
0: CP r35, r33
|
|
CP r36, r34
|
|
ADD64 r35, r35, r36
|
|
CP r33, r34
|
|
CP r34, r35
|
|
CP r35, r32
|
|
ADDI64 r35, r35, -1d
|
|
CP r32, r35
|
|
JMP :2
|
|
1: CP r1, r33
|
|
LD r31, r254, 0a, 48h
|
|
ADDI64 r254, r254, 48d
|
|
JALA r0, r31, 0a
|
|
fib:
|
|
ADDI64 r254, r254, -32d
|
|
ST r31, r254, 0a, 32h
|
|
CP r32, r2
|
|
LI64 r33, 2d
|
|
JLTS r32, r33, :0
|
|
CP r33, r32
|
|
ADDI64 r33, r33, -1d
|
|
CP r2, r33
|
|
JAL r31, r0, :fib
|
|
CP r33, r1
|
|
CP r34, r32
|
|
ADDI64 r34, r34, -2d
|
|
CP r2, r34
|
|
JAL r31, r0, :fib
|
|
CP r34, r1
|
|
ADD64 r33, r33, r34
|
|
CP r1, r33
|
|
JMP :1
|
|
0: CP r1, r32
|
|
1: LD r31, r254, 0a, 32h
|
|
ADDI64 r254, r254, 32d
|
|
JALA r0, r31, 0a
|
|
code size: 479
|
|
ret: 0
|
|
status: Ok(())
|