Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jmp start
- .resb 1024
- stack: .resb 1
- .macro call 1
- push a
- push b
- push c
- push d
- jsr %1
- .endmacro
- .macro ret 0
- rts
- pop d
- pop c
- pop b
- pop a
- .endmacro
- fib: ldi c #1
- xor a
- brz one
- ldi c #2
- xor a
- brz one
- ldi c #-1
- add a
- ldi c #-2
- add d
- mov a b
- call fib
- push a
- mov d b
- call fib
- mov a c
- pop b
- add a
- ret
- one: ldi a #1
- ret
- start: ldsp stack
- ldi b #8
- call fib
- hlt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement