Download IDE64 INTERFACE CARTRIDGE USER'S GUIDE

Transcript
PROGRAMMING IN ASSEMBLY
IDEDOS 0.90, May 22, 2015
Sometimes it’s used to restore the IRQ and NMI vectors, and a
simple remove will break the program. See Listing 34 for vector table
restore.
restor
lp
ldy
lda
sta
dey
bpl
rts
#$05
$fd30,y
$314,y
;restore interrupt
;vectors from kernal
lp
Listing 34: Interrupt vector restoring
This will restore BRK and NMI too, so the monitor won’t work.
If the program does not use NMI and you need the monitor for debugging, a simpler patch like in Listing 35 will do.
restor
lda
sta
lda
sta
rts
#<$ea31
$314
#>$ea31
$315
;restore irq only
13
Listing 35: IRQ vector restoring
Some programs really destroy the vector table, in this case one
first has to save the vector table at the program’s beginning to a safe
place, and restore it later. Here’s a short example code for vector table
handling in Listing 36.
N OTE
Never save a fixed vector table into the program, it won’t work
without IDE64 or with future versions of IDEDOS!
155