Pause button handler

.org $0066
; Pause button handler
    ; Do nothing

Remember how I turned off interrupts just now? Well, there are some interrupts you can’t turn off, officially called Non-Maskable Interrupts (NMIs). On the SMS they’re not too bad, they’re just used for the pause button.

Whenever the pause button is pressed, the code execution will stop whatever it’s doing and jump to offset $0066. It will then execute whatever’s there until it gets to a retn instruction (return from NMI), when it will go back to what it was doing before it was pressed. If we don’t want to do any special handling of the pause button, we should therefore put this command straight away at $0066. The .org $0066 directive tells WLA that this bit has to be at $0066.

< Boot | Lesson 1 | Initialisation >