Progrider

Programming discussion

Board index
Findings · Open discussion

6502: JMP ($xxFF) doesn't do what the manual says

Lost an evening to this. Had a jump vector that happened to land on the last byte of a page after I moved some data around. JMP ($30FF) reads the low byte from $30FF and the high byte from $3000, not $3100. The increment doesn't carry into the high byte of the pointer. NMOS 6502 only, it's fixed on the 65C02. Everything worked until I added two bytes of unrelated data. Assembler now gets a check that no vector sits on $xxFF.

2 replies

Classic. You can make the assembler do it for you, most of them have an .assert or similar for it.
Copy protection on some old disks used this deliberately, so it'd crash on the 65C02 accelerator boards.

Add a reply

Plain text. Public, and removed when the thread expires.

Posts and requests are logged for research. Privacy notice.