daver2
10k Member
Correct.
When you cold start the PET, the firmware uses a value of $AA to test memory out (and find the top of memory). This is fortunate, as $AA is a valid, single-byte instruction that doesn't do any 'damage'.
If you had loaded a BASIC program (playing invaders for example) before going back to your assembler code - entering SYS 4096 would have invariably crashed the machine - as the area of memory concerned would have invariably been overwritten...
SYS n just causes the 6502 CPU to start executing instructions at the address specified by 'n'. If this is a valid program, all well and good. If this is data - or 'random' stuff - bye bye CPU!
This is also why it is very important to SAVE your work BEFORE testing it! Been there, done that, got the tee shirt (when I was young)! Never done it again!
Dave
When you cold start the PET, the firmware uses a value of $AA to test memory out (and find the top of memory). This is fortunate, as $AA is a valid, single-byte instruction that doesn't do any 'damage'.
If you had loaded a BASIC program (playing invaders for example) before going back to your assembler code - entering SYS 4096 would have invariably crashed the machine - as the area of memory concerned would have invariably been overwritten...
SYS n just causes the 6502 CPU to start executing instructions at the address specified by 'n'. If this is a valid program, all well and good. If this is data - or 'random' stuff - bye bye CPU!
This is also why it is very important to SAVE your work BEFORE testing it! Been there, done that, got the tee shirt (when I was young)! Never done it again!
Dave