Prev: FD15 Up: Map Next: FD30
FD1A: set/read vectored I/O from (XY)
Used by the routine at FF8D.
Cb = 1 to read, Cb = 0 to set
FD1A 86 C3 STX $C3 save pointer low byte
FD1C 84 C4 STY $C4 save pointer high byte
FD1E A0 1F LDY #$1F set byte count
FD20 B9 14 03 LDA $0314,Y read vector byte from vectors
FD23 B0 02 BCS $FD27 branch if read vectors
FD25 B1 C3 LDA ($C3),Y read vector byte from (XY)
FD27 91 C3 STA ($C3),Y save byte to (XY)
FD29 99 14 03 STA $0314,Y save byte to vector
FD2C 88 DEY decrement index
FD2D 10 F1 BPL $FD20 loop if more to do
FD2F 60 RTS
The above code works but it tries to write to the ROM. while this is usually harmless systems that use flash ROM may suffer. Here is a version that makes the extra write to RAM instead but is otherwise identical in function.
FD1A STX $C3 save pointer low byte
FD1C STY $C4 save pointer high byte
FD1E LDY #$1F set byte count
FD20 LDA ($C3),Y read vector byte from (XY)
FD22 BCC $FD29 branch if set vectors
FD24 LDA $0314,Y else read vector byte from vectors
FD27 STA ($C3),Y save byte to (XY)
FD29 STA $0314,Y save byte to vector
FD2C DEY decrement index
FD2D BPL $FD20 loop if more to do
FD2F RTS
Prev: FD15 Up: Map Next: FD30