Difference between revisions of "Z80 wait instructions"
From MSX Game Library
Line 3: | Line 3: | ||
! Inst. !! TS !! Bytes !! Flag modification | ! Inst. !! TS !! Bytes !! Flag modification | ||
|- | |- | ||
− | | <tt>NOP</tt> | + | | <tt>NOP</tt> || 5 || 1 || None |
|- | |- | ||
− | | <tt>CP (HL)</tt> | + | | <tt>CP (HL)</tt> || 8 || 1 || C, S, and Z flags modified by definition. P/V detects overflow. |
|- | |- | ||
− | | <tt>NOP<br/>NOP</tt> || 10 || 2 || None | + | | <tt>NOP<br/>NOP</tt> || 10 || 2 || None |
|- | |- | ||
− | | <tt>LD R,A</tt> | + | | <tt>LD R,A</tt> || 11 || 2 || C is preserved, H and N are reset, and alters Z and S. P/V is set if interrupts are enabled, reset otherwise. |
|- | |- | ||
− | | <tt>NOP<br/>CP (HL)</tt>|| 13 || 2 || C, S, and Z flags modified by definition. P/V detects overflow. | + | | <tt>NOP<br/>CP (HL)</tt> || 13 || 2 || C, S, and Z flags modified by definition. P/V detects overflow. |
|- | |- | ||
− | | <tt>BIT 0,(HL)</tt> | + | | <tt>BIT 0,(HL)</tt> || 14 || 2 || Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |
|- | |- | ||
− | | <tt>NOP<br/>NOP<br/>NOP</tt> || 15 || 3 || None | + | | <tt>NOP<br/>NOP<br/>NOP</tt> || 15 || 3 || None |
|- | |- | ||
− | | <tt> | + | | <tt>CP (HL)<BR/>CP (HL)</tt> || 8 || 1 || C, S, and Z flags modified by definition. P/V detects overflow. |
|- | |- | ||
| <tt>NOP<br/>NOP<br/>CP (HL)</tt>|| 18 || 3 || C, S, and Z flags modified by definition. P/V detects overflow. | | <tt>NOP<br/>NOP<br/>CP (HL)</tt>|| 18 || 3 || C, S, and Z flags modified by definition. P/V detects overflow. | ||
|- | |- | ||
− | | <tt>NOP<br/>BIT 0,(HL)</tt> | + | | <tt>NOP<br/>BIT 0,(HL)</tt> || 19 || 3 || Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |
|- | |- | ||
| <tt>NOP<br/>NOP<br/>NOP<br/>NOP</tt> || 20 || 4 || None | | <tt>NOP<br/>NOP<br/>NOP<br/>NOP</tt> || 20 || 4 || None | ||
|- | |- | ||
− | | <tt>CP (IY+0)</tt> | + | | <tt>CP (IY+0)</tt> || 21 || 3 || C, S, and Z flags modified by definition. P/V detects overflow. |
|- | |- | ||
− | | <tt>BIT 0,(IY+0)</tt>|| 22 || 4 || Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. | + | | <tt>BIT 0,(IY+0)</tt> || 22 || 4 || Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |
|- | |- | ||
| <tt>NOP<br/>NOP<br/>NOP<br/>NOP<br/>NOP</tt> || 25 || 5 || None | | <tt>NOP<br/>NOP<br/>NOP<br/>NOP<br/>NOP</tt> || 25 || 5 || None | ||
|- | |- | ||
− | | <tt>NOP<br/>CP (IY+0)</tt> | + | | <tt>NOP<br/>CP (IY+0)</tt> || 26 || 4 || C, S, and Z flags modified by definition. P/V detects overflow. |
|- | |- | ||
− | | <tt>NOP<br/>BIT 0,(IY+0)</tt>|| 27 || 5 || Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. | + | | <tt>NOP<br/>BIT 0,(IY+0)</tt> || 27 || 5 || Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |
|} | |} |
Revision as of 23:24, 2 March 2024
Z80 instruction set that don't change registers value (except for F register):
Inst. | TS | Bytes | Flag modification |
---|---|---|---|
NOP | 5 | 1 | None |
CP (HL) | 8 | 1 | C, S, and Z flags modified by definition. P/V detects overflow. |
NOP NOP |
10 | 2 | None |
LD R,A | 11 | 2 | C is preserved, H and N are reset, and alters Z and S. P/V is set if interrupts are enabled, reset otherwise. |
NOP CP (HL) |
13 | 2 | C, S, and Z flags modified by definition. P/V detects overflow. |
BIT 0,(HL) | 14 | 2 | Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |
NOP NOP NOP |
15 | 3 | None |
CP (HL) CP (HL) |
8 | 1 | C, S, and Z flags modified by definition. P/V detects overflow. |
NOP NOP CP (HL) |
18 | 3 | C, S, and Z flags modified by definition. P/V detects overflow. |
NOP BIT 0,(HL) |
19 | 3 | Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |
NOP NOP NOP NOP |
20 | 4 | None |
CP (IY+0) | 21 | 3 | C, S, and Z flags modified by definition. P/V detects overflow. |
BIT 0,(IY+0) | 22 | 4 | Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |
NOP NOP NOP NOP NOP |
25 | 5 | None |
NOP CP (IY+0) |
26 | 4 | C, S, and Z flags modified by definition. P/V detects overflow. |
NOP BIT 0,(IY+0) |
27 | 5 | Opposite of the bit #0 is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined. |