view fib.s68 @ 1:5a2c1da6dd0f

Make sure all operations are long-word length on fib example.
author Mike Pavone <pavone@retrodev.com>
date Sat, 03 Nov 2012 21:37:38 -0700
parents 2432d177e1ac
children 4717146a7606
line wrap: on
line source

	lea 0, a7
	moveq #10, d0
	bsr fib
	illegal
fib:
	cmp.l #2, d0
	blt base
	subq.l #1, d0
	move.l d0, -(a7)
	bsr fib
	move.l (a7), d1
	exg d0, d1
	move.l d1, (a7)
	subq.l #1, d0
	bsr fib
	move.l (a7)+, d1
	add.l d1, d0
	rts
base:
	moveq #1, d0
	rts