litwr wrote:
I think more about the example provided and begin to have doubts in it. Let's see the general code of a complex structure
Code:
base_of_structure
VARIOUS UNALIGNED DATA
jmp_fiels .word ADDRESS
We have to calculate the absolute address of a jmp_field in order to use it then we should place these address to the JMP (). IMHO we may place the ADDRESS in JMP abs instead... I can also add that it is more common to keep addresses for JSR not for JMP... So I can imagine that it is very uneasy to create a practical example which shows the usefulness of CMOS JMP (xxFF)...
As I earlier said, you are beating a dead horse. This statement from Rockwell's newsletter is authoritative:
There is a error in the JUMP INDIRECT instruction of ALL 6500 family CPU chips, no matter who they were made by. This fatal error occurs only when the low byte of the indirect pointer location happens to be $FF, as in JMP ($03FF).
"Fatal error" means "bug," and truly is fatal if an errant jump lands the MPU on an undocumented opcode that causes a halt.
JMP (<addr>) is useful in many situations—I routinely use
JMP (<addr>) and
JMP (<addr>,X) in my software.
JMP (<addr>,X) is analogous to the
switch statement in ANSI C. In fact, POC V1.1's firmware routes the interrupt handlers and the SCSI bus phase dispatch code through indirect vectors. As a matter of tradition, I page-aligned these vectors, although it is unnecessary with the 65C816. However, long ago when I was writing for the NMOS versions, I didn't shy away from
JMP (<addr>) just because it was buggy. I merely stayed aware of where jump vectors ended up in my code.
If working with an NMOS part and using
JMP (<addr>) there's no magic to it: just page-align your vector tables. However, we consistently advise those interested in building hardware to not use the NMOS 6502, not only due to the
JMP ($xxFF) bug, but due to weak fanout, low clock speeds and the inability of RDY to halt the MPU during a write operation, the latter a characteristic which could, I suppose, also be considered a bug.