Difference between revisions of "Interrupt handler"

From MSX Game Library

Line 9: Line 9:
  
 
The code that is called during an interrupt is called an ISR (interrupt service routine).
 
The code that is called during an interrupt is called an ISR (interrupt service routine).
 +
 +
== Notes ==
 +
* <sup>#1</sup> In IM1 mode

Revision as of 13:44, 17 October 2025

The MSX interrupt mechanism is essential for gameplay synchronization, but also for using certain peripheral features (such as the graphics processor).

What is an interrupt?

As its name suggests, an interrupt is a mechanism that temporarily interrupts the execution of the current main program to execute another piece of code, before returning control back to the main code.

On an MSX, it is the Z80, the central processor, that manages this mechanism. It has a specific input connected to the internal BUS that allows it to communicate with all internal (such as the VDP) and external (via the cartridge port) peripherals.

When the Z80 receives an interrupt signal from a peripheral device, it calls a routine located at a fixed address in memory page 0 (address 0x0038). #1

The code that is called during an interrupt is called an ISR (interrupt service routine).

Notes

  • #1 In IM1 mode