LS7-Kernel/src/kernel/irq.s
0xMAC8205 c1f1b8c064 More Sub-Routine Planning
Wrote Hardware VRAM Routines
2023-11-01 01:59:25 +01:00

45 lines
1013 B
ArmAsm

irq_init:
; IRQ Init
; Initialises the VIA to be resetted into a normal state and
; to generate a constand IRQ Tick (Timer 1)
; Input:
; A => Timer 1 Tick Rate (MSB)
; Output: (none)
sta t1ch
lda #$40
sta acr
stz t1cl
lda #$00
sta ier
cli
rts
irq:
; IRQ
; This is the Standart IRQ Routine
; It scans the Keyboard, invokes the Tick Event Handler
; and does some other, housekeeping stuff
; Input: (none)
; Output: (none)
php ; Save Processor Status, A, X and Y
sta irq_a
stx irq_x
sty irq_y
bit t1cl ; "Ping" VIA Timer, to trigger Restart
lda irq_a ; Restore A, X, Y and Processor Status
ldx irq_x
ldy irq_y
plp
rti