Zilog timing charts contain the answer to your question.
During T3 and T4, an update occurs in all M1 cycles (operation code sample).
In the case of instructions with a single code, this is an update for each instruction. For instructions with one prefix (prefixes are read using M1 loops), there are two updates for each command.
For these strange instructions such as DD-CB-disp-opcode and FD-CB-disp-opcode (strange because the offset byte comes before the final operation code, not after it), the number of updates is at least 3 (for two prefixes and final opcode), but I'm not sure if the offset byte is read as part of the M1 cycle (which would cause another update) or a regular memory read cycle (without updating). I am inclined to believe that offset bytes are read in the M1 loop for these instructions, but I'm not sure. I asked Sean Young about this; he was not sure either. Does anyone know for sure?
UPDATE:
I answered my question: these are strange DD-CB-disp-opcode and instructions FD-CB-disp-opcode. If you check the Zilog documentation for these type instructions, such as RLC (IX + d), you will notice that the instruction requires 6 M-cycles and 23 T-cycles, broken down by: (4,4,3,5,4,3 )
We know that the first two M-cycles are M1 cycles for extracting the prefixes DD and CB (4 T-cycles each). The next M-loop reads the offset byte d. But this M-cycle uses only 3 T-cycles, not 4, so it cannot be an M1 cycle; instead, it is a normal memory read cycle.
Here's a breakdown of the RLC command (IX + d) into six M-cycles:
- M1 loop to read the 0xDD prefix (4 T-loops)
- M1 loop to read the 0xCB prefix (4 T-loops)
- Memory Read cycle to read the offset byte (3 T-cycles)
- M1 cycle for obtaining the operation code 0x06 and loading IX into the ALU (5 T-cycles)
- Read memory cycle for calculating and reading from address IX + d (4 T-cycles)
- Memory write cycle for calculating RLC and recording the result for address IX + d (3 T-cycles)
(RLC calculation covers M-cycles 5 and 6.)
These type instructions are unique in that they are the only Z80 instructions that have non-adjacent M1 cycles (M-cycles 1, 2, and 4 above). They are also the slowest!
Floor
user1219475
source share