Difference between revisions of "Z80 Instruction Table"
From SpecNext official Wiki
Line 12: | Line 12: | ||
|?seffect=S | |?seffect=S | ||
|?tstates=T-States | |?tstates=T-States | ||
+ | |?shortfx=Summary | ||
|mainlabel=- | |mainlabel=- | ||
}} | }} |
Revision as of 23:24, 31 August 2017
Mnemonic | Status | Addressing Mode 1 | Addressing Mode 2 | C | N | PV | H | Z | S | T-States | Summary |
---|---|---|---|---|---|---|---|---|---|---|---|
ADC A, (HL) | S | Accumulator | Indirect | S | 0 | V | S | S | S | 7 | A+=HL*+(CF?1:0) |
ADC A, (IXY+d) | S | Accumulator | Indexed | S | 0 | V | S | S | S | 19 | A+=(IXY+d)*+(CF?1:0) |
ADC A, n | S | Accumulator | Immediate | S | 0 | V | S | S | S | 7 | A+=n+(CF?1:0) |
ADC A, r | S | Accumulator | Register | S | 0 | V | S | S | S | 4 | A+=r+(CF?1:0) |
ADC HL, BC/DE/HL/SP | S | Register | Register | S | 0 | V | ! | S | S | 15 | HL+=rr+(CF?1:0) |
ADD A, (HL) | S | Accumulator | Indirect | S | 0 | V | S | S | S | 7 | A+=HL* |
ADD A, (IXY+d) | S | Accumulator | Indexed | S | 0 | V | S | S | S | 19 | A+=(IXY+d)* |
ADD A, n | S | Accumulator | Immediate | S | 0 | V | S | S | S | 7 | A+=n |
ADD A, r | S | Accumulator | Register | S | 0 | V | S | S | S | 4 | A+=r |
ADD HL, BC/DE/HL/SP | S | Register | Register | S | 0 | - | ! | - | - | 11 | HL+=rr |
ADD HL/DE/BC, A | E | Register | Register | ? | - | - | - | - | - | 8 | rr+=unsigned A |
ADD HL/DE/BC, nn | E | Register | Immediate | - | - | - | - | - | - | 16 | rr+=nn |
ADD IXY, BC/DE/IXY/SP | S | Register | Register | S | 0 | - | ! | - | - | 15 | IXY+=rr |
AND (HL) | S | Indirect | - | 0 | 0 | P | 1 | S | S | 7 | A := A & HL* |
AND (IXY+d) | S | Indexed | - | 0 | 0 | P | 1 | S | S | 19 | A := A & (IXY+d)* |
AND n | S | Immediate | - | 0 | 0 | P | 1 | S | S | 7 | A := A & n |
AND r | S | Register | - | 0 | 0 | P | 1 | S | S | 4 | A := A & r |
BIT b,(HL) | S | Immediate | Indirect | - | 0 | ? | 1 | ! | ? | 12 | HL*[b]==1? |
BIT b,(IXY+d) | S | Immediate | Indexed | - | 0 | ? | 1 | ! | ? | 20 | (IXY+d)*[b]==1? |
BIT b,r | S | Immediate | Register | - | 0 | ? | 1 | ! | ? | 8 | r[b]==1? |
BRLC DE,B | E | - | - | - | - | - | - | - | - | 8 | DE:=DE<<(B&15) OR DE>>(16-B&15) |
BSLA DE,B | E | - | - | - | - | - | - | - | - | 8 | DE:=DE<<(B&31) |
BSRA DE,B | E | - | - | - | - | - | - | - | - | 8 | DE:=signed(DE)>>(B&31) |
BSRF DE,B | E | - | - | - | - | - | - | - | - | 8 | DE:=~(unsigned(~DE)>>(B&31)) |
BSRL DE,B | E | - | - | - | - | - | - | - | - | 8 | DE:=unsigned(DE)>>(B&31) |
CALL Z/NZ/C/NC/PO/PE/P/M, nn | S | Address | - | - | - | - | - | - | - | 17 ; 10 if not cc | if cc {SP-=2; SP*:=PC; PC:=nn} |
CALL nn | S | Address | - | - | - | - | - | - | - | 17 | SP-=2; SP*:=PC; PC:=nn |
CCF | S | - | - | ! | 0 | - | ! | - | - | 4 | CF:=!CF |
CP (HL) | S | Indirect | - | S | 1 | V | S | S | S | 7 | A-=HL*? |
CP (IXY+d) | S | Indexed | - | S | 1 | V | S | S | S | 19 | A-=(IXY+d)? |
CP n | S | Immediate | - | S | 1 | V | S | S | S | 7 | A-=n? |
CP r | S | Register | - | S | 1 | V | S | S | S | 4 | A-=r? |
CPD | S | - | - | - | 1 | L | S | ! | S | 16 | HL*==A?; HL--; BC-- |
CPDR | S | - | - | - | 1 | L | S | ! | S | 21x+16 | do CPD while (!Z && BC>0) |
CPI | S | - | - | - | 1 | L | S | ! | S | 16 | HL*==A?; HL++; BC-- |
CPIR | S | - | - | - | 1 | L | S | ! | S | 21x+16 | do CPI while (!Z && BC>0) |
CPL | S | - | - | - | 1 | - | 1 | - | - | 4 | A:=~A |
DAA | S | - | - | ! | - | P | ! | S | S | 8 | if(A&$0F>$09 or HF) A±=$06; if(A&$F0>$90 or CF) A±=$60 (± depends on NF) |
DEC (HL) | S | Indirect | - | - | 1 | ! | S | S | S | 11 | HL*-- |
DEC (IXY+d) | S | Indexed | - | - | 1 | ! | S | S | S | 23 | (IXY+D)*-- |
DEC BC/DE/HL/SP | S | Register | - | - | - | - | - | - | - | 6 | rr-- |
DEC IXY | S | Register | - | - | - | - | - | - | - | 10 | rr-- |
DEC r | S | Register | - | - | 1 | ! | S | S | S | 4 | r-- |
DI | S | - | - | - | - | - | - | - | - | 4 | IFF1:=0; IFF2:=0 |
DJNZ n | S | Immediate | - | - | - | - | - | - | - | 13 | B--; if B!=0 PC+=nn |
EI | S | - | - | - | - | - | - | - | - | 4 | IFF1:=1; IFF2:=1 |
EX (SP), HL | S | Indirect | Register | - | - | - | - | - | - | 19 | swap(SP*,HL) |
EX (SP), IXY | S | Indirect | Register | - | - | - | - | - | - | 23 | swap(SP*,IXY) |
EX AF, AF' | S | Register | Register | ! | ! | ! | ! | ! | ! | 4 | swap(AF,AF') |
EX DE, HL | S | Register | Register | - | - | - | - | - | - | 4 | swap(DE,HL) |
... further results |