Difference between revisions of "Z80:Opcode Reference Chart"
(Initial automated import) |
KermMartian (talk | contribs) |
||
Line 8: | Line 8: | ||
| !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | | !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | ||
|- | |- | ||
− | ! 0 || [[Z80: | + | ! 0 || [[Z80:Opcodes:nop|nop]] || [[Z80:Opcodes:ld|ld bc,xx]] || [[Z80:Opcodes:ld|ld (bc),a]] || [[Z80:Opcodes:inc|inc bc]] || [[Z80:Opcodes:inc|inc b]] || [[Z80:Opcodes:dec|dec b]] || [[Z80:Opcodes:ld|ld b,x]] || [[Z80:Opcodes:rlca|rlca]] || [[Z80:Opcodes:ex|ex af,af']] || [[Z80:Opcodes:add|add hl,bc]] || [[Z80:Opcodes:ld|ld a,(bc)]] || [[Z80:Opcodes:dec|dec bc]] || [[Z80:Opcodes:inc|inc c]] || [[Z80:Opcodes:dec|dec c]] || [[Z80:Opcodes:ld|ld c,x]] || [[Z80:Opcodes:rrca|rrca]] |
|- | |- | ||
− | ! 1 || [[Z80: | + | ! 1 || [[Z80:Opcodes:djnz|djnz x]] || [[Z80:Opcodes:ld|ld de,xx]] || [[Z80:Opcodes:ld|ld (de),a]] || [[Z80:Opcodes:inc|inc de]] || [[Z80:Opcodes:inc|inc d]] || [[Z80:Opcodes:dec|dec d]] || [[Z80:Opcodes:ld|ld d,x]] || [[Z80:Opcodes:rla|rla]] || [[Z80:Opcodes:jr|jr x]] || [[Z80:Opcodes:add|add hl,de]] || [[Z80:Opcodes:ld|ld a,(de)]] || [[Z80:Opcodes:dec|dec de]] || [[Z80:Opcodes:inc|inc e]] || [[Z80:Opcodes:dec|dec e]] || [[Z80:Opcodes:ld|ld e,x]] || [[Z80:Opcodes:rra|rra]] |
|- | |- | ||
− | ! 2 || [[Z80: | + | ! 2 || [[Z80:Opcodes:jr|jr nz,x]] || [[Z80:Opcodes:ld|ld hl,xx]] || [[Z80:Opcodes:ld|ld (xx),hl]] || [[Z80:Opcodes:inc|inc hl]] || [[Z80:Opcodes:inc|inc h]] || [[Z80:Opcodes:dec|dec h]] || [[Z80:Opcodes:ld|ld h,x]] || [[Z80:Opcodes:daa|daa]] || [[Z80:Opcodes:jr|jr z,x]] || [[Z80:Opcodes:add|add hl,hl]] || [[Z80:Opcodes:ld|ld hl,(xx)]] || [[Z80:Opcodes:dec|dec hl]] || [[Z80:Opcodes:inc|inc l]] || [[Z80:Opcodes:dec|dec l]] || [[Z80:Opcodes:ld|ld l,x]] || [[Z80:Opcodes:cpl|cpl]] |
|- | |- | ||
− | ! 3 || [[Z80: | + | ! 3 || [[Z80:Opcodes:jr|jr nc,x]] || [[Z80:Opcodes:ld|ld sp,xx]] || [[Z80:Opcodes:ld|ld (xx),a]] || [[Z80:Opcodes:inc|inc sp]] || [[Z80:Opcodes:inc|inc (hl)]] || [[Z80:Opcodes:dec|dec (hl)]] || [[Z80:Opcodes:ld|ld (hl),x]] || [[Z80:Opcodes:scf|scf]] || [[Z80:Opcodes:jr|jr c,x]] || [[Z80:Opcodes:add|add hl,sp]] || [[Z80:Opcodes:ld|ld a,(xx)]] || [[Z80:Opcodes:dec|dec sp]] || [[Z80:Opcodes:inc|inc a]] || [[Z80:Opcodes:dec|dec a]] || [[Z80:Opcodes:ld|ld a,x]] || [[Z80:Opcodes:ccf|ccf]] |
|- | |- | ||
− | ! 4 || [[Z80: | + | ! 4 || [[Z80:Opcodes:ld|ld b,b]] || [[Z80:Opcodes:ld|ld b,c]] || [[Z80:Opcodes:ld|ld b,d]] || [[Z80:Opcodes:ld|ld b,e]] || [[Z80:Opcodes:ld|ld b,h]] || [[Z80:Opcodes:ld|ld b,l]] || [[Z80:Opcodes:ld|ld b,(hl)]] || [[Z80:Opcodes:ld|ld b,a]] || [[Z80:Opcodes:ld|ld c,b]] || [[Z80:Opcodes:ld|ld c,c]] || [[Z80:Opcodes:ld|ld c,d]] || [[Z80:Opcodes:ld|ld c,e]] || [[Z80:Opcodes:ld|ld c,h]] || [[Z80:Opcodes:ld|ld c,l]] || [[Z80:Opcodes:ld|ld c,(hl)]] || [[Z80:Opcodes:ld|ld c,a]] |
|- | |- | ||
− | ! 5 || [[Z80: | + | ! 5 || [[Z80:Opcodes:ld|ld d,b]] || [[Z80:Opcodes:ld|ld d,c]] || [[Z80:Opcodes:ld|ld d,d]] || [[Z80:Opcodes:ld|ld d,e]] || [[Z80:Opcodes:ld|ld d,h]] || [[Z80:Opcodes:ld|ld d,l]] || [[Z80:Opcodes:ld|ld d,(hl)]] || [[Z80:Opcodes:ld|ld d,a]] || [[Z80:Opcodes:ld|ld e,b]] || [[Z80:Opcodes:ld|ld e,c]] || [[Z80:Opcodes:ld|ld e,d]] || [[Z80:Opcodes:ld|ld e,e]] || [[Z80:Opcodes:ld|ld e,h]] || [[Z80:Opcodes:ld|ld e,l]] || [[Z80:Opcodes:ld|ld e,(hl)]] || [[Z80:Opcodes:ld|ld e,a]] |
|- | |- | ||
− | ! 6 || [[Z80: | + | ! 6 || [[Z80:Opcodes:ld|ld h,b]] || [[Z80:Opcodes:ld|ld h,c]] || [[Z80:Opcodes:ld|ld h,d]] || [[Z80:Opcodes:ld|ld h,e]] || [[Z80:Opcodes:ld|ld h,h]] || [[Z80:Opcodes:ld|ld h,l]] || [[Z80:Opcodes:ld|ld h,(hl)]] || [[Z80:Opcodes:ld|ld h,a]] || [[Z80:Opcodes:ld|ld l,b]] || [[Z80:Opcodes:ld|ld l,c]] || [[Z80:Opcodes:ld|ld l,d]] || [[Z80:Opcodes:ld|ld l,e]] || [[Z80:Opcodes:ld|ld l,h]] || [[Z80:Opcodes:ld|ld l,l]] || [[Z80:Opcodes:ld|ld l,(hl)]] || [[Z80:Opcodes:ld|ld l,a]] |
|- | |- | ||
− | ! 7 || [[Z80: | + | ! 7 || [[Z80:Opcodes:ld|ld (hl),b]] || [[Z80:Opcodes:ld|ld (hl),c]] || [[Z80:Opcodes:ld|ld (hl),d]] || [[Z80:Opcodes:ld|ld (hl),e]] || [[Z80:Opcodes:ld|ld (hl),h]] || [[Z80:Opcodes:ld|ld (hl),l]] || '''[[Z80:Opcodes:halt|halt]]''' || [[Z80:Opcodes:ld|ld (hl),a]] || [[Z80:Opcodes:ld|ld a,b]] || [[Z80:Opcodes:ld|ld a,c]] || [[Z80:Opcodes:ld|ld a,d]] || [[Z80:Opcodes:ld|ld a,e]] || [[Z80:Opcodes:ld|ld a,h]] || [[Z80:Opcodes:ld|ld a,l]] || [[Z80:Opcodes:ld|ld a,(hl)]] || [[Z80:Opcodes:ld|ld a,a]] |
|- | |- | ||
− | ! 8 || [[Z80: | + | ! 8 || [[Z80:Opcodes:add|add a,b]] || [[Z80:Opcodes:add|add a,c]] || [[Z80:Opcodes:add|add a,d]] || [[Z80:Opcodes:add|add a,e]] || [[Z80:Opcodes:add|add a,h]] || [[Z80:Opcodes:add|add a,l]] || [[Z80:Opcodes:add|add a,(hl)]] || [[Z80:Opcodes:add|add a,a]] || [[Z80:Opcodes:adc|adc a,b]] || [[Z80:Opcodes:adc|adc a,c]] || [[Z80:Opcodes:adc|adc a,d]] || [[Z80:Opcodes:adc|adc a,e]] || [[Z80:Opcodes:adc|adc a,h]] || [[Z80:Opcodes:adc|adc a,l]] || [[Z80:Opcodes:adc|adc a,(hl)]] || [[Z80:Opcodes:adc|adc a,a]] |
|- | |- | ||
− | ! 9 || [[Z80: | + | ! 9 || [[Z80:Opcodes:sub|sub b]] || [[Z80:Opcodes:sub|sub c]] || [[Z80:Opcodes:sub|sub d]] || [[Z80:Opcodes:sub|sub e]] || [[Z80:Opcodes:sub|sub h]] || [[Z80:Opcodes:sub|sub l]] || [[Z80:Opcodes:sub|sub (hl)]] || [[Z80:Opcodes:sub|sub a]] || [[Z80:Opcodes:sbc|sbc a,b]] || [[Z80:Opcodes:sbc|sbc a,c]] || [[Z80:Opcodes:sbc|sbc a,d]] || [[Z80:Opcodes:sbc|sbc a,e]] || [[Z80:Opcodes:sbc|sbc a,h]] || [[Z80:Opcodes:sbc|sbc a,l]] || [[Z80:Opcodes:sbc|sbc a,(hl)]] || [[Z80:Opcodes:sbc|sbc a,a]] |
|- | |- | ||
− | ! A || [[Z80: | + | ! A || [[Z80:Opcodes:and|and b]] || [[Z80:Opcodes:and|and c]] || [[Z80:Opcodes:and|and d]] || [[Z80:Opcodes:and|and e]] || [[Z80:Opcodes:and|and h]] || [[Z80:Opcodes:and|and l]] || [[Z80:Opcodes:and|and (hl)]] || [[Z80:Opcodes:and|and a]] || [[Z80:Opcodes:xor|xor b]] || [[Z80:Opcodes:xor|xor c]] || [[Z80:Opcodes:xor|xor d]] || [[Z80:Opcodes:xor|xor e]] || [[Z80:Opcodes:xor|xor h]] || [[Z80:Opcodes:xor|xor l]] || [[Z80:Opcodes:xor|xor (hl)]] || [[Z80:Opcodes:xor|xor a]] |
|- | |- | ||
− | ! B || [[Z80: | + | ! B || [[Z80:Opcodes:or|or b]] || [[Z80:Opcodes:or|or c]] || [[Z80:Opcodes:or|or d]] || [[Z80:Opcodes:or|or e]] || [[Z80:Opcodes:or|or h]] || [[Z80:Opcodes:or|or l]] || [[Z80:Opcodes:or|or (hl)]] || [[Z80:Opcodes:or|or a]] || [[Z80:Opcodes:cp|cp b]] || [[Z80:Opcodes:cp|cp c]] || [[Z80:Opcodes:cp|cp d]] || [[Z80:Opcodes:cp|cp e]] || [[Z80:Opcodes:cp|cp h]] || [[Z80:Opcodes:cp|cp l]] || [[Z80:Opcodes:cp|cp (hl)]] || [[Z80:Opcodes:cp|cp a]] |
|- | |- | ||
− | ! C || [[Z80: | + | ! C || [[Z80:Opcodes:ret|ret nz]] || [[Z80:Opcodes:pop|pop bc]] || [[Z80:Opcodes:jp|jp nz,xx]] || [[Z80:Opcodes:jp|jp xx]] || [[Z80:Opcodes:call|call nz,xx]] || [[Z80:Opcodes:push|push bc]] || [[Z80:Opcodes:add|add a,x]] || [[Z80:Opcodes:rst|rst 00h]] || [[Z80:Opcodes:ret|ret z]] || '''[[Z80:Opcodes:ret|ret]]''' || [[Z80:Opcodes:jp|jp z,xx]] || '''xxBITxx''' || [[Z80:Opcodes:call|call z,xx]] || [[Z80:Opcodes:call|call xx]] || [[Z80:Opcodes:adc|adc a,x]] || [[Z80:Opcodes:rst|rst 08h]] |
|- | |- | ||
− | ! D || [[Z80: | + | ! D || [[Z80:Opcodes:ret|ret nc]] || [[Z80:Opcodes:pop|pop de]] || [[Z80:Opcodes:jp|jp nc,xx]] || [[Z80:Opcodes:out|out (x),a]] || [[Z80:Opcodes:call|call nc,xx]] || [[Z80:Opcodes:push|push de]] || [[Z80:Opcodes:sub|sub x]] || [[Z80:Opcodes:rst|rst 10h]] || [[Z80:Opcodes:ret|ret c]] || [[Z80:Opcodes:exx|exx]] || [[Z80:Opcodes:jp|jp c,xx]] || [[Z80:Opcodes:in|in a,(x)]] || [[Z80:Opcodes:call|call c,xx]] || '''xxIXxx''' || [[Z80:Opcodes:sbc|sbc a,x]] || [[Z80:Opcodes:rst|rst 18h]] |
|- | |- | ||
− | ! E || [[Z80: | + | ! E || [[Z80:Opcodes:ret|ret po]] || [[Z80:Opcodes:pop|pop hl]] || [[Z80:Opcodes:jp|jp po,xx]] || [[Z80:Opcodes:ex|ex (sp),hl]] || [[Z80:Opcodes:call|call po,xx]] || [[Z80:Opcodes:push|push hl]] || [[Z80:Opcodes:and|and x]] || [[Z80:Opcodes:rst|rst 20h]] || [[Z80:Opcodes:ret|ret pe]] || [[Z80:Opcodes:jp|jp (hl)]] || [[Z80:Opcodes:jp|jp pe,xx]] || [[Z80:Opcodes:ex|ex de,hl]] || [[Z80:Opcodes:call|call pe,xx]] || '''xx80xx''' || [[Z80:Opcodes:xor|xor x]] || [[Z80:Opcodes:rst|rst 28h]] |
|- | |- | ||
− | ! F || [[Z80: | + | ! F || [[Z80:Opcodes:ret|ret p]] || [[Z80:Opcodes:pop|pop af]] || [[Z80:Opcodes:jp|jp p,xx]] || [[Z80:Opcodes:di|di]] || [[Z80:Opcodes:call|call p,xx]] || [[Z80:Opcodes:push|push af]] || [[Z80:Opcodes:or|or x]] || [[Z80:Opcodes:rst|rst 30h]] || [[Z80:Opcodes:ret|ret m]] || [[Z80:Opcodes:ld|ld sp,hl]] || [[Z80:Opcodes:jp|jp m,xx]] || [[Z80:Opcodes:ei|ei]] || [[Z80:Opcodes:call|call m,xx]] || '''xxIYxx''' || [[Z80:Opcodes:cp|cp x]] || [[Z80:Opcodes:rst|rst 38h]] |
|} | |} | ||
Line 46: | Line 46: | ||
| !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | | !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | ||
|- | |- | ||
− | ! 4 || [[Z80: | + | ! 4 || [[Z80:Opcodes:in|in b,(c)]] || [[Z80:Opcodes:out|out (c),b]] || [[Z80:Opcodes:sbc|sbc hl,bc]] || [[Z80:Opcodes:ld|ld (xx),bc]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:retn|retn]] || [[Z80:Opcodes:im|im 0]] || [[Z80:Opcodes:ld|ld i,a]] || [[Z80:Opcodes:in|in c,(c)]] || [[Z80:Opcodes:out|out (c),c]] || [[Z80:Opcodes:adc|adc hl,bc]] || [[Z80:Opcodes:ld|ld bc,(xx)]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:reti|reti]] || || [[Z80:Opcodes:ld|ld r,a]] |
|- | |- | ||
− | ! 5 || [[Z80: | + | ! 5 || [[Z80:Opcodes:in|in d,(c)]] || [[Z80:Opcodes:out|out (c),d]] || [[Z80:Opcodes:sbc|sbc hl,de]] || [[Z80:Opcodes:ld|ld (xx),de]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:retn|retn]] || [[Z80:Opcodes:im|im 1]] || [[Z80:Opcodes:ld|ld a,i]] || [[Z80:Opcodes:in|in e,(c)]] || [[Z80:Opcodes:out|out (c),e]] || [[Z80:Opcodes:adc|adc hl,de]] || [[Z80:Opcodes:ld|ld de,(xx)]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:retn|retn]] || [[Z80:Opcodes:im|im 2]] || [[Z80:Opcodes:ld|ld a,r]] |
|- | |- | ||
− | ! 6 || [[Z80: | + | ! 6 || [[Z80:Opcodes:in|in h,(c)]] || [[Z80:Opcodes:out|out (c),h]] || [[Z80:Opcodes:sbc|sbc hl,hl]] || [[Z80:Opcodes:ld|ld (xx),hl]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:retn|retn]] || || [[Z80:Opcodes:rrd|rrd]] || [[Z80:Opcodes:in|in l,(c)]] || [[Z80:Opcodes:out|out (c),l]] || [[Z80:Opcodes:adc|adc hl,hl]] || [[Z80:Opcodes:ld|ld hl,(xx)]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:retn|retn]] || || [[Z80:Opcodes:rld|rld]] |
|- | |- | ||
− | ! 7 || [[Z80: | + | ! 7 || [[Z80:Opcodes:in|in f,(c)]] || [[Z80:Opcodes:out|out (c),f]] || [[Z80:Opcodes:sbc|sbc hl,sp]] || [[Z80:Opcodes:ld|ld (xx),sp]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:retn|retn]] || || || [[Z80:Opcodes:in|in a,(c)]] || [[Z80:Opcodes:out|out (c),a]] || [[Z80:Opcodes:adc|adc hl,sp]] || [[Z80:Opcodes:ld|ld sp,(xx)]] || [[Z80:Opcodes:neg|neg]] || [[Z80:Opcodes:reti|reti]] || || |
|- | |- | ||
− | ! A || [[Z80: | + | ! A || [[Z80:Opcodes:ldi|ldi]] || [[Z80:Opcodes:cpi|cpi]] || [[Z80:Opcodes:ini|ini]] || [[Z80:Opcodes:outi|outi]] || || || || || [[Z80:Opcodes:ldd|ldd]] || [[Z80:Opcodes:cpd|cpd]] || [[Z80:Opcodes:ind|ind]] || [[Z80:Opcodes:outd|outd]] || || || || |
|- | |- | ||
− | ! B || [[Z80: | + | ! B || [[Z80:Opcodes:ldir|ldir]] || [[Z80:Opcodes:cpir|cpir]] || [[Z80:Opcodes:inir|inir]] || [[Z80:Opcodes:otir|otir]] || || || || || [[Z80:Opcodes:lddr|lddr]] || [[Z80:Opcodes:cpdr|cpdr]] || [[Z80:Opcodes:indr|indr]] || [[Z80:Opcodes:otdr|otdr]] || || || || |
|} | |} | ||
Line 65: | Line 65: | ||
| !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | | !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | ||
|- | |- | ||
− | ! 0 || [[Z80: | + | ! 0 || [[Z80:Opcodes:rlc|rlc b]] || [[Z80:Opcodes:rlc|rlc c]] || [[Z80:Opcodes:rlc|rlc d]] || [[Z80:Opcodes:rlc|rlc e]] || [[Z80:Opcodes:rlc|rlc h]] || [[Z80:Opcodes:rlc|rlc l]] || [[Z80:Opcodes:rlc|rlc (hl)]] || [[Z80:Opcodes:rlc|rlc a]] || [[Z80:Opcodes:rrc|rrc b]] || [[Z80:Opcodes:rrc|rrc c]] || [[Z80:Opcodes:rrc|rrc d]] || [[Z80:Opcodes:rrc|rrc e]] || [[Z80:Opcodes:rrc|rrc h]] || [[Z80:Opcodes:rrc|rrc l]] || [[Z80:Opcodes:rrc|rrc (hl)]] || [[Z80:Opcodes:rrc|rrc a]] |
|- | |- | ||
− | ! 1 || [[Z80: | + | ! 1 || [[Z80:Opcodes:rl|rl b]] || [[Z80:Opcodes:rl|rl c]] || [[Z80:Opcodes:rl|rl d]] || [[Z80:Opcodes:rl|rl e]] || [[Z80:Opcodes:rl|rl h]] || [[Z80:Opcodes:rl|rl l]] || [[Z80:Opcodes:rl|rl (hl)]] || [[Z80:Opcodes:rl|rl a]] || [[Z80:Opcodes:rr|rr b]] || [[Z80:Opcodes:rr|rr c]] || [[Z80:Opcodes:rr|rr d]] || [[Z80:Opcodes:rr|rr e]] || [[Z80:Opcodes:rr|rr h]] || [[Z80:Opcodes:rr|rr l]] || [[Z80:Opcodes:rr|rr (hl)]] || [[Z80:Opcodes:rr|rr a]] |
|- | |- | ||
− | ! 2 || [[Z80: | + | ! 2 || [[Z80:Opcodes:sla|sla b]] || [[Z80:Opcodes:sla|sla c]] || [[Z80:Opcodes:sla|sla d]] || [[Z80:Opcodes:sla|sla e]] || [[Z80:Opcodes:sla|sla h]] || [[Z80:Opcodes:sla|sla l]] || [[Z80:Opcodes:sla|sla (hl)]] || [[Z80:Opcodes:sla|sla a]] || [[Z80:Opcodes:sra|sra b]] || [[Z80:Opcodes:sra|sra c]] || [[Z80:Opcodes:sra|sra d]] || [[Z80:Opcodes:sra|sra e]] || [[Z80:Opcodes:sra|sra h]] || [[Z80:Opcodes:sra|sra l]] || [[Z80:Opcodes:sra|sra (hl)]] || [[Z80:Opcodes:sra|sra a]] |
|- | |- | ||
− | ! 3 || [[Z80: | + | ! 3 || [[Z80:Opcodes:sll|sll b]] || [[Z80:Opcodes:sll|sll c]] || [[Z80:Opcodes:sll|sll d]] || [[Z80:Opcodes:sll|sll e]] || [[Z80:Opcodes:sll|sll h]] || [[Z80:Opcodes:sll|sll l]] || [[Z80:Opcodes:sll|sll (hl)]] || [[Z80:Opcodes:sll|sll a]] || [[Z80:Opcodes:srl|srl b]] || [[Z80:Opcodes:srl|srl c]] || [[Z80:Opcodes:srl|srl d]] || [[Z80:Opcodes:srl|srl e]] || [[Z80:Opcodes:srl|srl h]] || [[Z80:Opcodes:srl|srl l]] || [[Z80:Opcodes:srl|srl (hl)]] || [[Z80:Opcodes:srl|srl a]] |
|- | |- | ||
− | ! 4 || [[Z80: | + | ! 4 || [[Z80:Opcodes:bit|bit 0,b]] || [[Z80:Opcodes:bit|bit 0,c]] || [[Z80:Opcodes:bit|bit 0,d]] || [[Z80:Opcodes:bit|bit 0,e]] || [[Z80:Opcodes:bit|bit 0,h]] || [[Z80:Opcodes:bit|bit 0,l]] || [[Z80:Opcodes:bit|bit 0,(hl)]] || [[Z80:Opcodes:bit|bit 0,a]] || [[Z80:Opcodes:bit|bit 1,b]] || [[Z80:Opcodes:bit|bit 1,c]] || [[Z80:Opcodes:bit|bit 1,d]] || [[Z80:Opcodes:bit|bit 1,e]] || [[Z80:Opcodes:bit|bit 1,h]] || [[Z80:Opcodes:bit|bit 1,l]] || [[Z80:Opcodes:bit|bit 1,(hl)]] || [[Z80:Opcodes:bit|bit 1,a]] |
|- | |- | ||
− | ! 5 || [[Z80: | + | ! 5 || [[Z80:Opcodes:bit|bit 2,b]] || [[Z80:Opcodes:bit|bit 2,c]] || [[Z80:Opcodes:bit|bit 2,d]] || [[Z80:Opcodes:bit|bit 2,e]] || [[Z80:Opcodes:bit|bit 2,h]] || [[Z80:Opcodes:bit|bit 2,l]] || [[Z80:Opcodes:bit|bit 2,(hl)]] || [[Z80:Opcodes:bit|bit 2,a]] || [[Z80:Opcodes:bit|bit 3,b]] || [[Z80:Opcodes:bit|bit 3,c]] || [[Z80:Opcodes:bit|bit 3,d]] || [[Z80:Opcodes:bit|bit 3,e]] || [[Z80:Opcodes:bit|bit 3,h]] || [[Z80:Opcodes:bit|bit 3,l]] || [[Z80:Opcodes:bit|bit 3,(hl)]] || [[Z80:Opcodes:bit|bit 3,a]] |
|- | |- | ||
− | ! 6 || [[Z80: | + | ! 6 || [[Z80:Opcodes:bit|bit 4,b]] || [[Z80:Opcodes:bit|bit 4,c]] || [[Z80:Opcodes:bit|bit 4,d]] || [[Z80:Opcodes:bit|bit 4,e]] || [[Z80:Opcodes:bit|bit 4,h]] || [[Z80:Opcodes:bit|bit 4,l]] || [[Z80:Opcodes:bit|bit 4,(hl)]] || [[Z80:Opcodes:bit|bit 4,a]] || [[Z80:Opcodes:bit|bit 5,b]] || [[Z80:Opcodes:bit|bit 5,c]] || [[Z80:Opcodes:bit|bit 5,d]] || [[Z80:Opcodes:bit|bit 5,e]] || [[Z80:Opcodes:bit|bit 5,h]] || [[Z80:Opcodes:bit|bit 5,l]] || [[Z80:Opcodes:bit|bit 5,(hl)]] || [[Z80:Opcodes:bit|bit 5,a]] |
|- | |- | ||
− | ! 7 || [[Z80: | + | ! 7 || [[Z80:Opcodes:bit|bit 6,b]] || [[Z80:Opcodes:bit|bit 6,c]] || [[Z80:Opcodes:bit|bit 6,d]] || [[Z80:Opcodes:bit|bit 6,e]] || [[Z80:Opcodes:bit|bit 6,h]] || [[Z80:Opcodes:bit|bit 6,l]] || [[Z80:Opcodes:bit|bit 6,(hl)]] || [[Z80:Opcodes:bit|bit 6,a]] || [[Z80:Opcodes:bit|bit 7,b]] || [[Z80:Opcodes:bit|bit 7,c]] || [[Z80:Opcodes:bit|bit 7,d]] || [[Z80:Opcodes:bit|bit 7,e]] || [[Z80:Opcodes:bit|bit 7,h]] || [[Z80:Opcodes:bit|bit 7,l]] || [[Z80:Opcodes:bit|bit 7,(hl)]] || [[Z80:Opcodes:bit|bit 7,a]] |
|- | |- | ||
− | ! 8 || [[Z80: | + | ! 8 || [[Z80:Opcodes:res|res 0,b]] || [[Z80:Opcodes:res|res 0,c]] || [[Z80:Opcodes:res|res 0,d]] || [[Z80:Opcodes:res|res 0,e]] || [[Z80:Opcodes:res|res 0,h]] || [[Z80:Opcodes:res|res 0,l]] || [[Z80:Opcodes:res|res 0,(hl)]] || [[Z80:Opcodes:res|res 0,a]] || [[Z80:Opcodes:res|res 1,b]] || [[Z80:Opcodes:res|res 1,c]] || [[Z80:Opcodes:res|res 1,d]] || [[Z80:Opcodes:res|res 1,e]] || [[Z80:Opcodes:res|res 1,h]] || [[Z80:Opcodes:res|res 1,l]] || [[Z80:Opcodes:res|res 1,(hl)]] || [[Z80:Opcodes:res|res 1,a]] |
|- | |- | ||
− | ! 9 || [[Z80: | + | ! 9 || [[Z80:Opcodes:res|res 2,b]] || [[Z80:Opcodes:res|res 2,c]] || [[Z80:Opcodes:res|res 2,d]] || [[Z80:Opcodes:res|res 2,e]] || [[Z80:Opcodes:res|res 2,h]] || [[Z80:Opcodes:res|res 2,l]] || [[Z80:Opcodes:res|res 2,(hl)]] || [[Z80:Opcodes:res|res 2,a]] || [[Z80:Opcodes:res|res 3,b]] || [[Z80:Opcodes:res|res 3,c]] || [[Z80:Opcodes:res|res 3,d]] || [[Z80:Opcodes:res|res 3,e]] || [[Z80:Opcodes:res|res 3,h]] || [[Z80:Opcodes:res|res 3,l]] || [[Z80:Opcodes:res|res 3,(hl)]] || [[Z80:Opcodes:res|res 3,a]] |
|- | |- | ||
− | ! A || [[Z80: | + | ! A || [[Z80:Opcodes:res|res 4,b]] || [[Z80:Opcodes:res|res 4,c]] || [[Z80:Opcodes:res|res 4,d]] || [[Z80:Opcodes:res|res 4,e]] || [[Z80:Opcodes:res|res 4,h]] || [[Z80:Opcodes:res|res 4,l]] || [[Z80:Opcodes:res|res 4,(hl)]] || [[Z80:Opcodes:res|res 4,a]] || [[Z80:Opcodes:res|res 5,b]] || [[Z80:Opcodes:res|res 5,c]] || [[Z80:Opcodes:res|res 5,d]] || [[Z80:Opcodes:res|res 5,e]] || [[Z80:Opcodes:res|res 5,h]] || [[Z80:Opcodes:res|res 5,l]] || [[Z80:Opcodes:res|res 5,(hl)]] || [[Z80:Opcodes:res|res 5,a]] |
|- | |- | ||
− | ! B || [[Z80: | + | ! B || [[Z80:Opcodes:res|res 6,b]] || [[Z80:Opcodes:res|res 6,c]] || [[Z80:Opcodes:res|res 6,d]] || [[Z80:Opcodes:res|res 6,e]] || [[Z80:Opcodes:res|res 6,h]] || [[Z80:Opcodes:res|res 6,l]] || [[Z80:Opcodes:res|res 6,(hl)]] || [[Z80:Opcodes:res|res 6,a]] || [[Z80:Opcodes:res|res 7,b]] || [[Z80:Opcodes:res|res 7,c]] || [[Z80:Opcodes:res|res 7,d]] || [[Z80:Opcodes:res|res 7,e]] || [[Z80:Opcodes:res|res 7,h]] || [[Z80:Opcodes:res|res 7,l]] || [[Z80:Opcodes:res|res 7,(hl)]] || [[Z80:Opcodes:res|res 7,a]] |
|- | |- | ||
− | ! C || [[Z80: | + | ! C || [[Z80:Opcodes:set|set 0,b]] || [[Z80:Opcodes:set|set 0,c]] || [[Z80:Opcodes:set|set 0,d]] || [[Z80:Opcodes:set|set 0,e]] || [[Z80:Opcodes:set|set 0,h]] || [[Z80:Opcodes:set|set 0,l]] || [[Z80:Opcodes:set|set 0,(hl)]] || [[Z80:Opcodes:set|set 0,a]] || [[Z80:Opcodes:set|set 1,b]] || [[Z80:Opcodes:set|set 1,c]] || [[Z80:Opcodes:set|set 1,d]] || [[Z80:Opcodes:set|set 1,e]] || [[Z80:Opcodes:set|set 1,h]] || [[Z80:Opcodes:set|set 1,l]] || [[Z80:Opcodes:set|set 1,(hl)]] || [[Z80:Opcodes:set|set 1,a]] |
|- | |- | ||
− | ! D || [[Z80: | + | ! D || [[Z80:Opcodes:set|set 2,b]] || [[Z80:Opcodes:set|set 2,c]] || [[Z80:Opcodes:set|set 2,d]] || [[Z80:Opcodes:set|set 2,e]] || [[Z80:Opcodes:set|set 2,h]] || [[Z80:Opcodes:set|set 2,l]] || [[Z80:Opcodes:set|set 2,(hl)]] || [[Z80:Opcodes:set|set 2,a]] || [[Z80:Opcodes:set|set 3,b]] || [[Z80:Opcodes:set|set 3,c]] || [[Z80:Opcodes:set|set 3,d]] || [[Z80:Opcodes:set|set 3,e]] || [[Z80:Opcodes:set|set 3,h]] || [[Z80:Opcodes:set|set 3,l]] || [[Z80:Opcodes:set|set 3,(hl)]] || [[Z80:Opcodes:set|set 3,a]] |
|- | |- | ||
− | ! E || [[Z80: | + | ! E || [[Z80:Opcodes:set|set 4,b]] || [[Z80:Opcodes:set|set 4,c]] || [[Z80:Opcodes:set|set 4,d]] || [[Z80:Opcodes:set|set 4,e]] || [[Z80:Opcodes:set|set 4,h]] || [[Z80:Opcodes:set|set 4,l]] || [[Z80:Opcodes:set|set 4,(hl)]] || [[Z80:Opcodes:set|set 4,a]] || [[Z80:Opcodes:set|set 5,b]] || [[Z80:Opcodes:set|set 5,c]] || [[Z80:Opcodes:set|set 5,d]] || [[Z80:Opcodes:set|set 5,e]] || [[Z80:Opcodes:set|set 5,h]] || [[Z80:Opcodes:set|set 5,l]] || [[Z80:Opcodes:set|set 5,(hl)]] || [[Z80:Opcodes:set|set 5,a]] |
|- | |- | ||
− | ! F || [[Z80: | + | ! F || [[Z80:Opcodes:set|set 6,b]] || [[Z80:Opcodes:set|set 6,c]] || [[Z80:Opcodes:set|set 6,d]] || [[Z80:Opcodes:set|set 6,e]] || [[Z80:Opcodes:set|set 6,h]] || [[Z80:Opcodes:set|set 6,l]] || [[Z80:Opcodes:set|set 6,(hl)]] || [[Z80:Opcodes:set|set 6,a]] || [[Z80:Opcodes:set|set 7,b]] || [[Z80:Opcodes:set|set 7,c]] || [[Z80:Opcodes:set|set 7,d]] || [[Z80:Opcodes:set|set 7,e]] || [[Z80:Opcodes:set|set 7,h]] || [[Z80:Opcodes:set|set 7,l]] || [[Z80:Opcodes:set|set 7,(hl)]] || [[Z80:Opcodes:set|set 7,a]] |
|} | |} | ||
Line 114: | Line 114: | ||
== Additional Information == | == Additional Information == | ||
− | Most of the instructions have more information [[Z80: | + | Most of the instructions have more information [[Z80:Opcodes|here]], or click on the instruction. |
'''Source:''' | '''Source:''' |
Revision as of 07:25, 6 February 2016
This is an opcode reference chart for on-calculator programming and/or size optimizations.
Rows are first nibble, columns are second.
Contents
Primary
xx80xx (ED)
!! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | ||||||||||||||||
4 | in b,(c) | out (c),b | sbc hl,bc | ld (xx),bc | neg | retn | im 0 | ld i,a | in c,(c) | out (c),c | adc hl,bc | ld bc,(xx) | neg | reti | ld r,a | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | in d,(c) | out (c),d | sbc hl,de | ld (xx),de | neg | retn | im 1 | ld a,i | in e,(c) | out (c),e | adc hl,de | ld de,(xx) | neg | retn | im 2 | ld a,r |
6 | in h,(c) | out (c),h | sbc hl,hl | ld (xx),hl | neg | retn | rrd | in l,(c) | out (c),l | adc hl,hl | ld hl,(xx) | neg | retn | rld | ||
7 | in f,(c) | out (c),f | sbc hl,sp | ld (xx),sp | neg | retn | in a,(c) | out (c),a | adc hl,sp | ld sp,(xx) | neg | reti | ||||
A | ldi | cpi | ini | outi | ldd | cpd | ind | outd | ||||||||
B | ldir | cpir | inir | otir | lddr | cpdr | indr | otdr |
xxBITxx (CB)
Blank spaces or spaces not listed function like NOP.
xxIXxx (DD)
If the next byte is CB, it will follow xxIXBITxx, described later below. If the next byte is DD, ED, or FD, the current DD (the xxIXxx) will be ignored (functions like NOP).
Functions like the primary table, except each instance of hl is replaced with ix, h with ixh, and l with ixl, except in the case of (hl). (hl) will be replaced by (ix+x), where x is an 8-bit displacement, and all other h and l are unaffected. For example, ld ixh, (ix+x) is not an instruction, but ld h, (ix+x) is.
xxIYxx (FD)
Same as xxIXxx, but instead with IY, IYH, and IYL.
xxIXBITxx (DDCB)
Functions like xxBITxx, but instead applying the bitwise operations to (ix+x), then if the instruction wasn't BIT return the result to the register if it is not (hl). For example, rlc b becomes rlc (ix+x)->b.
xxIYBITxx (FDCB)
Same as xxIXBITxx, but instead with IY, IYH, and IYL.
Additional Information
Most of the instructions have more information here, or click on the instruction.
Source: Primary, xx80xx, xxBITxx: Xeda Elnara, aka Zeda xxIXxx, xxIYxx, xxIXBITxx, xxIYBITxx: www.z80.info/decoding.htm