summaryrefslogtreecommitdiff
path: root/test/fib2.s
blob: 23f0bf58e2da1d0793ebc64963d6e9d87f00ee9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

.org 0
init:
	cps		; Clear the Processor Status register.
start:
	and #0		; Reset the accumulator.
	tab		;
	tax		;
	tay		;
	inb		;
	clc		;
fib:
	tya		;
	adc b		; Add x with y. But did we also carry over?
	bcs start	; Yes, so restart.
	tax		;
	tya		;
	tab		;
	txa		;
	tay		;
	bra fib		; No, so keep looping.
a
d