Quote:
Originally Posted by julie_m
Yet one more common optimisation you can do by hand on the Z-80 and the 6502 is to use a two-byte relative jump (which happens only to be available as a conditional instruction), if you know in advance that the processor state will always be favourable (e.g., a SUBtract or DECrease instruction will always leave the carry flag set if it produced a positive value), as opposed to a three-byte unconditional absolute jump.
|
No need to do this on the Z80 as it has a 2 byte unconditional relative jump instruction i.e.
JR xx
with the opcode 18H in the first byte and 2s complement offset in the second.
I too am mystified about the statement that programming in assembly language is somehow less efficient than programming in machine code. If they felt so inclined, the assembly language programmer could employ any of the tricks stated above.
John