News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Z80 16-bit increment/decrement

Started by ralferoo, 14:59, 09 November 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ralferoo


ralferoo

#1
BTW, if you remember, in 32-character-width screen mode I made the comment:
Quote from: ralferoo on 00:41, 01 November 13
Another example: ADD HL,DE
You've got a single byte instruction. 1us.
The ALU calculates E+L. 1us
The ALU calculates D+H+carry. 1us (actually, I don't know why this isn't pipelined!)
Total: 3us
Well, the reason is explained in this blog post...  ;D
Quote
One timing consequence of using the incrementer latch for 16-bit register-to-register transfers is that it cannot be overlapped with the instruction fetch. Many Z-80 instructions are pipelined and don't finish until several cycles into the next instruction, since register and ALU operations can take place while the Z-80 is fetching the next instruction from memory. However, the PC uses the incrementer during instruction fetch to advance to the next instruction. Thus, any transfer using the incrementer latch must finish before the next instruction starts.
Also:
Quote
Unlike the ALU, the incrementer/decrementer doesn't compute parity, negative, carry, or zero values. This is why the 16-bit increment/decrement instructions don't update the status flags.

Powered by SMFPacks Menu Editor Mod