Difference between revisions of "Z80:Opcode Reference Chart"
KermMartian (talk | contribs) |
KermMartian (talk | contribs) |
||
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]] | ! 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]] | ||
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]] | ! 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]] | ||
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]] | ! 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]] |
Revision as of 07:26, 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