; 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