Prev: EE38 Up: Map Next: EE5E
EE40: Interrupt setup
Used by the routine at diamond_zoom_in_mask.
See http://www.breakintoprogram.co.uk/hardware/computers/zx-spectrum/interrupts
setup_interrupts EE40 DI Disable interrupts
EE41 LD HL,$FD00 Address of interrupt vector table
EE44 LD A,H Interrupt vector table high byte
Point the 128 interrupt vector table words at $FD00 to $FEFE.
EE45 LD B,$00 256 iterations
EE47 LD C,$FE C = $FE
si_fill EE49 LD (HL),C *HL++ = $FE
EE4A INC HL
EE4B DJNZ si_fill Loop
Now store an additional byte since the IVT needs to be 257 bytes long.
EE4D LD (HL),C Store final $FE
EE4E LD I,A Set interrupt vector table base to $FD00
EE50 IM 2 Set interrupt mode 2
Set $FEFE to be "JP $EF19".
EE52 LD A,$C3 $FEFE = Opcode for JP
EE54 LD ($FEFE),A
EE57 LD HL,$EF19 $FEFF = interrupt_entry
EE5A LD ($FEFF),HL
EE5D RET Return
Prev: EE38 Up: Map Next: EE5E