view timer.s16 @ 25:fb14515266f4

Implemented timer and timer interrupts. Added get/setvbr instructions. Fixed assembler bug. Moved mnemonics into a separate source file
author Michael Pavone <pavone@retrodev.com>
date Thu, 31 Mar 2016 23:25:52 -0700
parents
children cb078b3b23e8
line wrap: on
line source

	ldim vectors, r0
	setvbr r0
	;current color value
	ldim 0, r0
	;color increment
	ldim $11, r3
	ldimh $1, r3
	;Palette RAM address
	ldim 0, r1
	ldimh $FF, r1
	;enable interrupt
	ori 1, sr
	;Timer Value
	ldim $FF, r2
	ldimh $FF, r2
	outi $A, r2
wait
	bra wait
	;shouldn't get here, disable timer so it's clear something broke
	ldim 0, r2
	outi $A, r2
	bra wait

vectors:
	dc.w timer_handler
	
timer_handler
	outi $E, r1
	outi $F, r0
	add r3, r0, r0
	reti r4