Characteristics of Interrupts and Wake-up Mechanisms in 6502 Assembly

1. Maskable Interrupts (IRQ)

  • Can be enabled/disabled by setting the I bit in the status register
  • Typically used for interrupt requests from external devices
  • Automatically saves the PC and P registers to the stack upon response

2. Non-Maskable Interrupts (NMI)

  • Cannot be disabled by software
  • Usually used for emergencies (e.g., power failure)
  • Has a higher priority than IRQ

3. Reset

  • A special type of interrupt
  • Reinitializes the CPU

Characteristics of Wake-up Mechanisms

1. Automatic Save and Restore

  • Automatically saves the PC and P registers to the stack during interrupt response
  • The RTI instruction automatically restores these registers

2. Context Protection

  • Requires manual saving of general-purpose registers (A, X, Y)
  • This is the programmer’s responsibility

Leave a Comment