diff options
Diffstat (limited to 'test/fib2.s')
-rw-r--r-- | test/fib2.s | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fib2.s b/test/fib2.s new file mode 100644 index 0000000..d8c0d42 --- /dev/null +++ b/test/fib2.s @@ -0,0 +1,26 @@ +; Variables for thread 0. +.org $1000 +x: + .qword $0 +y: + .qword $1 +z: + .qword $0 + +.org $0 +init: + cps ; Clear the Processor Status register. + +start: + lda #0 ; Clear the accumulator. + ldb.q y ; b=1. +fib: + aab ; Add x with y. + ldb.q y + stb.q x ; x=y. + sta.q y ; y=z. + tab + lda.q x + bcs start ; Start all over again, if the carry flag was set. + jmp fib ; Otherwise, keep looping. +done |