Difference between revisions of "Interrupt handler"
From MSX Game Library
(→What is an interrupt?) |
|||
Line 1: | Line 1: | ||
− | The MSX interrupt mechanism is essential for [[gameplay synchronization]], but also for using certain peripheral features (such as the graphics processor). | + | 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? == | == 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 to the main code. | + | 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. | 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 a peripheral | + | 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). <sup>[[#Notes|#1]]</sup> |
− | + | The code that is called during an interrupt is called an ISR (interrupt service routine). | |
− |
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).