Just an info about using STZ on C65/MEGA65 (65CE02 CPU):
If you use a code written for the 65C02 on the C65/MEGA65 it is important to know this difference:
On the 65C02 STZ (opcode $64,$74,$9C, $9E) means "Stores a zero byte value into memory":
(Source: http://www.obelisk.me.uk/65C02/reference.html)
On the 65CE02 STZ (also the same opcodes $64,$74,$9C, $9E) means "Store Z register to memory":
Be aware of the typo in this table (it has to be correctly 65CE02) :
(Source: https://www.commodore.ca/manua…ments/chipdata/65ce02.txt)
It means that STZ on the 65C02 always stores zero into the memory and on the 65CE02 the exact same command with the exact same opcodes stores the value of the z register into the memory!
If Z was set to 0, STZ behaves the same on the 65CE02 as on the 65C02.
Knowing and remember this can save you days of debugging while trying to use a 65C02 code an the C65/MEGA65! I know what I'm talking about!