liveBook · Manning

Sei instruction

As explained in Classic Game Programming on the NES: Make your own retro video game

The SEI instruction sets the 6502 interrupt-disable flag to disable maskable interrupts.

SEI clears the 6502 interrupt flag, disabling interrupts during NES startup. This prevents interrupt activity while the PPU, APU, and control registers are initialized. section 5.12

Disable interrupts at reset

Place sei at the start of the reset routine, before configuring hardware: sei; lda #0; sta PPU_CONTROL; sta PPU_MASK; sta APU_DM_CONTROL. section 5.12

How Classic Game Programming on the NES: Make your own retro video game covers it

How deep it goes
Explains the flag effect and placement in startup code without detailing interrupt handling internals.
Examples
Uses a reset listing that executes SEI before writing hardware control registers.
What you can do after
Operate NES startup code by placing SEI before hardware initialization.
How it connects
Connects interrupt control with reset routines, PPU initialization, APU initialization, and NMI configuration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Classic Game Programming on the NES: Make your own retro video game. The section links point to the parts of the book it draws on.