Code: Select all
* = $1200
; Initialize
Init: lda #<Target ; Install the custom NMI (restart)
sta $0318 ; ,,
lda #>Target ; ,,
sta $0319 ; ,,
; Fall through to Target
; Do something
Target: ldx #$fb ; Reset stack for NMI restart
txs ; ,,
cli ; Clear SEI from $FEA9 in ROM
inc $900f ; Do some visible thing, it doesn't matter what
forever: jmp forever ; And then do nothing
Code: Select all
LAB_FEA9
SEI ; disable interrupts
JMP (LAB_0318) ; do NMI vector