EUG PD


Secret 8 Bytes Of Memory

 
Published in EUG #24

On startup, the 6502A reads the address stored at &FFFF &FFFE which it uses to point to the address to be jumped to in the event of an IRQ. As it is in ROM, it is fixed by the operating system and so can be read ready for disassembly.

Next it reads the address at &FFFA &FFFB which is the address to jump to in the event of an NMI in a similar manner to above.

Thirdly, it performs a JMP (&FFFC) which is defined as the address pointing to the start of the operating system. This also varies from operating system to operating system but for the 6502 series, it is always at &FFFC.

The result of all this? The familiar (?) CALL !-4 from BASIC makes sense. It resets the BBC by restarting the operating system. Any *KEY10s will also work because, as far as the OS is concerned, the 6502's RST pins has been taken low.

-4 in two's complement is FFFFFFFC and when using the BASIC CALL statement, the lower two bytes (of location FFFC) only are used by BASIC hence reset:

   "PRESS A KEY TO RESET":A=((?&FFFD*256)+?&FFFC)
or CALL !-4 for short.

Robert Sprowson, EUG #24

Robert Sprowson