From 861d56e556b597115ad01b4b4cc0e5b932545ce9 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 10 Jan 2020 16:35:34 -0500 Subject: Added GPLv2. We're now Free Software!!! --- test/fib2.s | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/fib2.s (limited to 'test/fib2.s') 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 -- cgit v1.2.3-13-gbd6f