This lesson will give you some more in depth information on the way you can access data: addressing methods. So what exactly does addressing mean? Well, take for example LD A,($1234). Here, the data comes from a memory address. With LD A,(HL) the data also comes from a memory address, but this is register indirect addressing. It happens through the HL register.
Register Addressing |
Immediate Addressing |
Immediate Extended Addressing |
Extended Addressing |
Register Indirect Addressing |
Indexed Addressing |
Relative Addressing |
Modified Page Zero Addressing |
Implied Addressing |
The data is in one of the Z-80 registers or registerpairs.
8-bits data is stored in the memory immediately after the opcode for the instruction
Immediate extended addressing
Same as above, but the data is 16-bit this time
Immediately after the opcode, there is a data word. A call or a jump needs to
be made to that address or data needs to be received from that address.
Register Indirect Addressing
One of the register couples contains the address of the data
This way looks a lot like Register Indirect Addressing, but the Z-80 adds a
byte (signed) to the address first. It only works with IX and IY.
To save time and memory, an address can sometimes be given with only 1 byte
(signed). The real 2-byte address is then calculated starting from the
Program Counter (Address=PC+2+offset).
Modified Page Zero Addressing
The only page 0 addressing instructions on the Z-80 are the RST instructions.
The address is calculated by putting the most significant bytes to $00 and
the least significant byte to the given one.
One or both of the operands are not given in the instruction.
The Z-80 contains some instructions to set, reset and test a bit in a byte.
Previous lesson |