Add interrupt based timer and test code

This commit is contained in:
Byron Lathi
2023-01-03 18:20:34 -05:00
parent 1ac3bdf614
commit 32a78a4aff
10 changed files with 639 additions and 74 deletions

View File

@@ -0,0 +1,39 @@
.code
LEDS = $efff
TIMER_BASE = $eff8
TIMER_DIVISOR = 2
TIMER_CL = 0
TIMER_LL = 0
TIMER_CH = 1
TIMER_LH = 1
TIMER_STATUS = 3
TIMER_CONTROL = 3
TIMER_OLD = $10
main:
lda #$ff
sta TIMER_BASE+TIMER_DIVISOR
lda #$01
sta TIMER_BASE+TIMER_CONTROL
lda #$00
sta TIMER_BASE+TIMER_LH
lda #$10
sta TIMER_BASE+TIMER_LL
cli
loop:
wai
bra loop
irq:
lda TIMER_BASE
inc LEDS
rti
.segment "VECTORS"
.addr main
.addr main
.addr irq