Previous: , Up: Z80-Dependent   [Contents][Index]


9.56.5 Opcodes

In line with common practice, Z80 mnemonics are used for the Z80, Z80N, Z180, eZ80, Ascii R800 and the GameBoy Z80.

In many instructions it is possible to use one of the half index registers (‘ixl’,‘ixh’,‘iyl’,‘iyh’) in stead of an 8-bit general purpose register. This yields instructions that are documented on the eZ80 and the R800, undocumented on the Z80 and unsupported on the Z180. Similarly in f,(c) is documented on the R800, undocumented on the Z80 and unsupported on the Z180 and the eZ80.

The assembler also supports the following undocumented Z80-instructions, that have not been adopted in any other instruction set:

out (c),0

Sends zero to the port pointed to by register C.

sli m

Equivalent to m = (m<<1)+1, the operand m can be any operand that is valid for ‘sla’. One can use ‘sll’ as a synonym for ‘sli’.

op (ix+d), r

This is equivalent to

ld r, (ix+d)
op r
ld (ix+d), r

The operation ‘op’ may be any of ‘res b,’, ‘set b,’, ‘rl’, ‘rlc’, ‘rr’, ‘rrc’, ‘sla’, ‘sli’, ‘sra’ and ‘srl’, and the register ‘r’ may be any of ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘h’ and ‘l’.

op (iy+d), r

As above, but with ‘iy’ instead of ‘ix’.

The web site at http://www.z80.info is a good starting place to find more information on programming the Z80.

You may enable or disable any of these instructions for any target CPU even this instruction is not supported by any real CPU of this type. Useful for custom CPU cores.


Previous: , Up: Z80-Dependent   [Contents][Index]