Difference between revisions of "Z80:Opcode Reference Chart"
KermMartian (talk | contribs) |
KermMartian (talk | contribs) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | + | ! !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | |
|- | |- | ||
− | + | | 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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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 44: | Line 44: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | + | ! !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | |
|- | |- | ||
− | + | | 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: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: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: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: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: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 63: | Line 63: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | + | ! !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F | |
|- | |- | ||
− | + | | 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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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]] | |
|} | |} | ||
Latest revision as of 08:19, 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