Project restructuring to support the new direction
This commit is contained in:
34
example/asm/fib.scm
Normal file
34
example/asm/fib.scm
Normal file
@@ -0,0 +1,34 @@
|
||||
(variable result 0)
|
||||
(ref result)
|
||||
(push fib)
|
||||
(call)
|
||||
(push cleanup)
|
||||
(jmp)
|
||||
fib
|
||||
(dup)
|
||||
(push 0)
|
||||
(=)
|
||||
(over)
|
||||
(push 1)
|
||||
(=)
|
||||
(or)
|
||||
(push recur)
|
||||
(branch)
|
||||
(return)
|
||||
recur
|
||||
(dup)
|
||||
(push 1)
|
||||
(-)
|
||||
(push fib)
|
||||
(call)
|
||||
(over)
|
||||
(push 2)
|
||||
(-)
|
||||
(push fib)
|
||||
(call)
|
||||
(+)
|
||||
(nip)
|
||||
(return)
|
||||
cleanup
|
||||
(set! result)
|
||||
(bye)
|
||||
Reference in New Issue
Block a user