Empty program: Difference between revisions
m
→Nintendo Entertainment System
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 21:
===Nintendo Entertainment System===
Without an infinite loop the program counter will execute undefined behavior, depending on how "empty" bytes are padded. If we're generous and assume that empty bytes are padded with <code>NOP</code>, eventually the program counter will attempt to execute the interrupt vectors as executable code
<lang 6502asm>.org $8000 ;
RESET: ;execution starts here
JMP RESET
NMI: ;NMI can't happen if the screen is off. No need for RTI
IRQ: ;this will never occur without a CLI command.
.org $FFFA ;all 6502 based hardware uses this section of memory to hold the addresses of interrupt routines
|