summaryrefslogtreecommitdiff
path: root/test/fib2.s
blob: ee5869731c1b07790425ba00459bf266d2208740 (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		;
	jmp fib		; No, so keep looping.
a
d