6502-OS/system/irq_handler.s65

44 lines
824 B
Plaintext
Raw Permalink Normal View History

2023-12-22 02:17:58 +01:00
; .include "irq_handler.h65"
; .bss
2023-12-21 17:28:02 +01:00
2023-12-22 02:17:58 +01:00
; .code
2023-12-21 17:28:02 +01:00
2023-12-22 02:17:58 +01:00
; .proc register_via_handler
; .endproc
2023-12-21 17:28:02 +01:00
2023-12-22 02:17:58 +01:00
; .proc remove_via_handler
; .endproc
2023-12-21 17:28:02 +01:00
2023-12-22 02:17:58 +01:00
; .proc main_handler
; Print "Unknown IRQ"
; rti
; .endproc
2023-12-21 17:28:02 +01:00
2023-12-22 02:17:58 +01:00
; .zeropage
; tmp: .res 1
2023-12-21 17:28:02 +01:00
2023-12-22 02:17:58 +01:00
; .macro VIAHandler via_addr, via_handlers_table
; lda via_addr + IO::IFR
; sta tmp
; bbr7 tmp,@rts ; irq
; bbs0 tmp,@ca2
; bbs1 tmp,@ca1
; bbs2 tmp,@sr
; bbs3 tmp,@cb2
; bbs4 tmp,@cb1
; bbs5 tmp,@t2
; bbs6 tmp,@t1
; ; TODO error, one should have been true
; stp
; @rts:
; rts
; @ca2: jmp (via_handlers_table)
; @ca1: jmp (via_handlers_table+2)
; @sr: jmp (via_handlers_table+4)
; @cb2: jmp (via_handlers_table+6)
; @cb1: jmp (via_handlers_table+8)
; @t2: jmp (via_handlers_table+10)
; @t1: jmp (via_handlers_table+12)
; .endmacro