Interrupts; Interrupt Procedure - Nintendo DMG-01 - Game Boy Console Manual

Manual
Table of Contents

Advertisement

2.11. Serial I/O
allows a certain amount of synchronization with each
serial port.
The state of the last bit shifted out determines the
state of the output line until another transfer takes
place.
If a serial transfer with internal clock is performed
and no external GameBoy is present, a value of $FF
will be received in the transfer.
The following code causes $75 to be shifted out the
serial port and a byte to be shifted into $FF01:
ld
a,$75
ld
($FF01),a
ld
a,$81
ld
($FF02),a

2.12. Interrupts

2.12.1. Interrupt Procedure

The IME (interrupt master enable) flag is reset by DI
and prohibits all interrupts. It is set by EI and
acknowledges the interrupt setting by the IE register.
1. When an interrupt is generated, the IF flag will be
set.
2. If the IME flag is set & the corresponding IE flag
is set, the following 3 steps are performed.
3. Reset the IME flag and prevent all interrupts.
4. The PC (program counter) is pushed onto the stack.
5. Jump to the starting address of the interrupt.
Page 32
TM
Game Boy
CPU Manual
V 1.01

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Game boy

Table of Contents