2015-06-24 02:59:44 +00:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Processor specific code
|
|
|
|
|
|
|
|
# CPU = "Z80"
|
|
|
|
# Description = "Zilog 8-bit microprocessor."
|
|
|
|
# DataWidth = 8 # 8-bit data
|
|
|
|
# AddressWidth = 16 # 16-bit addresses
|
|
|
|
|
|
|
|
# Maximum length of an instruction (for formatting purposes)
|
|
|
|
maxLength = 3
|
|
|
|
|
|
|
|
# Leadin bytes for multibyte instructions
|
2015-06-25 23:35:39 +00:00
|
|
|
leadInBytes = [0xcb, 0xdd, 0xed, 0xfd]
|
2015-06-24 02:59:44 +00:00
|
|
|
|
|
|
|
# Addressing mode table
|
|
|
|
# List of addressing modes and corresponding format strings for operands.
|
|
|
|
addressModeTable = {
|
|
|
|
"implied" : "",
|
2015-06-25 02:41:15 +00:00
|
|
|
"a" : "a",
|
|
|
|
"b" : "b",
|
|
|
|
"c" : "c",
|
|
|
|
"d" : "d",
|
|
|
|
"e" : "e",
|
|
|
|
"h" : "h",
|
|
|
|
"l" : "l",
|
|
|
|
"sp" : "sp",
|
|
|
|
"bc" : "bc",
|
|
|
|
"de" : "de",
|
|
|
|
"hl" : "hl",
|
2015-06-25 23:35:39 +00:00
|
|
|
"a,a" : "a,a",
|
|
|
|
"a,b" : "a,b",
|
|
|
|
"a,c" : "a,c",
|
|
|
|
"a,d" : "a,d",
|
|
|
|
"a,e" : "a,e",
|
|
|
|
"a,h" : "a,h",
|
|
|
|
"a,l" : "a,l",
|
2015-06-25 03:19:47 +00:00
|
|
|
"b,a" : "b,a",
|
|
|
|
"b,b" : "b,b",
|
|
|
|
"b,c" : "b,c",
|
|
|
|
"b,d" : "b,d",
|
|
|
|
"b,e" : "b,e",
|
|
|
|
"b,h" : "b,h",
|
|
|
|
"b,l" : "b,l",
|
|
|
|
"c,l" : "c,l",
|
|
|
|
"c,a" : "c,a",
|
|
|
|
"c,b" : "c,b",
|
|
|
|
"c,c" : "c,c",
|
|
|
|
"c,d" : "c,d",
|
|
|
|
"c,e" : "c,e",
|
|
|
|
"c,h" : "c,h",
|
|
|
|
"d,a" : "d,a",
|
|
|
|
"d,b" : "d,b",
|
|
|
|
"d,c" : "d,c",
|
|
|
|
"d,d" : "d,d",
|
|
|
|
"d,e" : "d,e",
|
|
|
|
"d,h" : "d,h",
|
|
|
|
"d,l" : "d,l",
|
|
|
|
"e,a" : "e,a",
|
|
|
|
"e,b" : "e,b",
|
|
|
|
"e,c" : "e,c",
|
|
|
|
"e,d" : "e,d",
|
|
|
|
"e,e" : "e,e",
|
|
|
|
"e,h" : "e,h",
|
|
|
|
"e,l" : "e,l",
|
|
|
|
"h,a" : "h,a",
|
|
|
|
"h,b" : "h,b",
|
|
|
|
"h,c" : "h,c",
|
|
|
|
"h,d" : "h,d",
|
|
|
|
"h,e" : "h,e",
|
|
|
|
"h,h" : "h,h",
|
|
|
|
"h,l" : "h,l",
|
|
|
|
"l,b" : "l,b",
|
|
|
|
"l,a" : "l,a",
|
|
|
|
"l,c" : "l,c",
|
|
|
|
"l,d" : "l,d",
|
|
|
|
"l,e" : "l,e",
|
|
|
|
"l,h" : "l,h",
|
|
|
|
"l,l" : "l,l",
|
2015-06-25 02:41:15 +00:00
|
|
|
"af,af" : "af,af",
|
|
|
|
"hl,bc" : "hl,bc",
|
|
|
|
"hl,de" : "hl,bc",
|
|
|
|
"hl,hl" : "hl,hl",
|
|
|
|
"hl,sp" : "hl,sp",
|
|
|
|
"bc,nn" : "bc,${1:02X}{0:02X}",
|
|
|
|
"de,nn" : "de,${1:02X}{0:02X}",
|
|
|
|
"hl,nn" : "hl,${1:02X}{0:02X}",
|
|
|
|
"sp,nn" : "sp,${1:02X}{0:02X}",
|
|
|
|
"indnn,hl" : "(${1:02X}{0:02X}),hl",
|
|
|
|
"indhl,n" : "(hl),(${0:02X})",
|
|
|
|
"a,indnn" : "a,(${1:02X}{0:02X})",
|
|
|
|
"indnn,a" : "(${1:02X}{0:02X}),a",
|
|
|
|
"hl,indnn" : "hl,(${1:02X}{0:02X})",
|
|
|
|
"indbc,a" : "(bc),a",
|
|
|
|
"indde,a" : "(de),a",
|
|
|
|
"indhl" : "(hl)",
|
2015-06-25 03:19:47 +00:00
|
|
|
"indhl,a" : "(hl),a",
|
|
|
|
"indhl,b" : "(hl),b",
|
|
|
|
"indhl,c" : "(hl),c",
|
|
|
|
"indhl,d" : "(hl),d",
|
|
|
|
"indhl,e" : "(hl),e",
|
|
|
|
"indhl,h" : "(hl),h",
|
|
|
|
"indhl,l" : "(hl),l",
|
2015-06-25 02:41:15 +00:00
|
|
|
"a,indde" : "a,(de)",
|
|
|
|
"a,indbc" : "a,(bc)",
|
2015-06-25 03:19:47 +00:00
|
|
|
"b,indhl" : "b,(hl)",
|
2015-06-25 23:35:39 +00:00
|
|
|
"a,indhl" : "a,(hl)",
|
2015-06-25 03:19:47 +00:00
|
|
|
"c,indhl" : "c,(hl)",
|
|
|
|
"d,indhl" : "d,(hl)",
|
|
|
|
"e,indhl" : "e,(hl)",
|
|
|
|
"h,indhl" : "h,(hl)",
|
|
|
|
"l,indhl" : "l,(hl)",
|
2015-06-25 02:41:15 +00:00
|
|
|
"n" : "${0:02X}",
|
|
|
|
"a,n" : "a,${0:02X}",
|
|
|
|
"b,n" : "b,${0:02X}",
|
|
|
|
"c,n" : "b,${0:02X}",
|
|
|
|
"d,n" : "d,${0:02X}",
|
|
|
|
"e,n" : "e,${0:02X}",
|
|
|
|
"h,n" : "h,${0:02X}",
|
|
|
|
"l,n" : "l,${0:02X}",
|
|
|
|
"nz,n" : "nz,${0:04X}",
|
|
|
|
"z,n" : "z,${0:04X}",
|
|
|
|
"nc,n" : "nc,${0:04X}",
|
|
|
|
"c,n" : "c,${0:04X}",
|
2015-06-24 02:59:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Op Code Table
|
|
|
|
# Key is numeric opcode (possibly multiple bytes)
|
|
|
|
# Value is a list:
|
|
|
|
# # bytes
|
|
|
|
# mnemonic
|
|
|
|
# addressing mode
|
|
|
|
# flags (e.g. pcr)
|
|
|
|
opcodeTable = {
|
|
|
|
|
|
|
|
0x00 : [ 1, "nop", "implied" ],
|
2015-06-25 02:41:15 +00:00
|
|
|
0x01 : [ 3, "ld", "bc,nn" ],
|
|
|
|
0x02 : [ 1, "ld", "indbc,a" ],
|
|
|
|
0x03 : [ 1, "inc", "bc" ],
|
|
|
|
0x04 : [ 1, "inc", "b" ],
|
|
|
|
0x05 : [ 1, "dec", "b" ],
|
|
|
|
0x06 : [ 2, "ld", "b,n" ],
|
2015-06-24 02:59:44 +00:00
|
|
|
0x07 : [ 1, "rlca", "implied" ],
|
2015-06-25 02:41:15 +00:00
|
|
|
0x08 : [ 1, "ex", "af,af" ],
|
|
|
|
0x09 : [ 1, "add", "hl,bc" ],
|
|
|
|
0x0a : [ 1, "ld", "a,indbc" ],
|
|
|
|
0x0b : [ 1, "dec", "bc" ],
|
|
|
|
0x0c : [ 1, "inc", "c" ],
|
|
|
|
0x0d : [ 1, "dec", "c" ],
|
|
|
|
0x0e : [ 2, "ld", "c,n" ],
|
2015-06-24 02:59:44 +00:00
|
|
|
0x0f : [ 1, "rrca", "implied" ],
|
|
|
|
|
2015-06-25 02:41:15 +00:00
|
|
|
0x10 : [ 2, "djnz", "n", pcr ],
|
|
|
|
0x11 : [ 3, "ld", "de,nn" ],
|
|
|
|
0x12 : [ 1, "ld", "indde,a" ],
|
|
|
|
0x13 : [ 1, "inc", "de" ],
|
|
|
|
0x14 : [ 1, "inc", "d" ],
|
|
|
|
0x15 : [ 1, "dec", "d" ],
|
|
|
|
0x16 : [ 2, "ld", "d,n" ],
|
2015-06-24 02:59:44 +00:00
|
|
|
0x17 : [ 1, "rla", "implied" ],
|
2015-06-25 02:41:15 +00:00
|
|
|
0x18 : [ 2, "jr", "n", pcr ],
|
|
|
|
0x19 : [ 1, "add", "hl,de" ],
|
|
|
|
0x1a : [ 1, "ld", "a,indde" ],
|
|
|
|
0x1b : [ 1, "dec", "de" ],
|
|
|
|
0x1c : [ 1, "inc", "e" ],
|
|
|
|
0x1d : [ 1, "dec", "e" ],
|
|
|
|
0x1e : [ 2, "ld", "e,n" ],
|
2015-06-24 02:59:44 +00:00
|
|
|
0x1f : [ 1, "rra", "implied" ],
|
|
|
|
|
2015-06-25 02:41:15 +00:00
|
|
|
0x20 : [ 2, "jr", "nz,n" ],
|
|
|
|
0x21 : [ 3, "ld", "hl,nn" ],
|
|
|
|
0x22 : [ 3, "ld", "indnn,hl" ],
|
|
|
|
0x23 : [ 1, "inc", "hl" ],
|
|
|
|
0x24 : [ 1, "inc", "h" ],
|
|
|
|
0x25 : [ 1, "dec", "h" ],
|
|
|
|
0x26 : [ 2, "ld", "h,n" ],
|
|
|
|
0x27 : [ 1, "daa", "implied" ],
|
|
|
|
0x28 : [ 2, "jr", "z,n", pcr ],
|
|
|
|
0x29 : [ 1, "add", "hl,hl" ],
|
|
|
|
0x2a : [ 3, "ld", "hl,indnn" ],
|
|
|
|
0x2b : [ 1, "dec", "hl" ],
|
|
|
|
0x2c : [ 1, "inc", "l" ],
|
|
|
|
0x2d : [ 1, "dec", "l" ],
|
|
|
|
0x2e : [ 2, "ld", "l,n" ],
|
|
|
|
0x2f : [ 1, "cpl", "implied" ],
|
|
|
|
|
|
|
|
0x30 : [ 2, "jr", "nc,n", pcr ],
|
|
|
|
0x31 : [ 3, "ld", "sp,nn" ],
|
|
|
|
0x32 : [ 3, "ld", "indnn,a" ],
|
|
|
|
0x33 : [ 1, "inc", "sp" ],
|
|
|
|
0x34 : [ 1, "inc", "indhl" ],
|
|
|
|
0x35 : [ 1, "dec", "indhl" ],
|
|
|
|
0x36 : [ 2, "ld", "indhl,n" ],
|
|
|
|
0x37 : [ 1, "scf", "implied" ],
|
|
|
|
0x38 : [ 2, "jr", "c,n", pcr ],
|
|
|
|
0x39 : [ 1, "add", "hl,sp" ],
|
|
|
|
0x3a : [ 3, "ld", "a,indnn" ],
|
|
|
|
0x3b : [ 1, "dec", "sp" ],
|
|
|
|
0x3c : [ 1, "inc", "a" ],
|
|
|
|
0x3d : [ 1, "dec", "a" ],
|
|
|
|
0x3e : [ 2, "ld", "a,n" ],
|
2015-06-25 03:19:47 +00:00
|
|
|
0x3f : [ 1, "ccf", "implied" ],
|
2015-06-25 02:41:15 +00:00
|
|
|
|
2015-06-25 03:19:47 +00:00
|
|
|
0x40 : [ 1, "ld", "b,b" ],
|
|
|
|
0x41 : [ 1, "ld", "b,c" ],
|
|
|
|
0x42 : [ 1, "ld", "b,d" ],
|
|
|
|
0x43 : [ 1, "ld", "b,e" ],
|
|
|
|
0x44 : [ 1, "ld", "b,h" ],
|
|
|
|
0x45 : [ 1, "ld", "b,l" ],
|
|
|
|
0x46 : [ 1, "ld", "b,indhl" ],
|
|
|
|
0x47 : [ 1, "ld", "b,a" ],
|
|
|
|
0x48 : [ 1, "ld", "c,b" ],
|
|
|
|
0x49 : [ 1, "ld", "c,c" ],
|
|
|
|
0x4a : [ 1, "ld", "c,d" ],
|
|
|
|
0x4b : [ 1, "ld", "c,e" ],
|
|
|
|
0x4c : [ 1, "ld", "c,h" ],
|
|
|
|
0x4d : [ 1, "ld", "c,l" ],
|
|
|
|
0x4e : [ 1, "ld", "c,indhl" ],
|
|
|
|
0x4f : [ 1, "ld", "c,a" ],
|
|
|
|
|
|
|
|
0x50 : [ 1, "ld", "d,b" ],
|
|
|
|
0x51 : [ 1, "ld", "d,c" ],
|
|
|
|
0x52 : [ 1, "ld", "d,d" ],
|
|
|
|
0x53 : [ 1, "ld", "d,e" ],
|
|
|
|
0x54 : [ 1, "ld", "d,h" ],
|
|
|
|
0x55 : [ 1, "ld", "d,l" ],
|
|
|
|
0x56 : [ 1, "ld", "d,indhl" ],
|
|
|
|
0x57 : [ 1, "ld", "d,a" ],
|
|
|
|
0x58 : [ 1, "ld", "e,b" ],
|
|
|
|
0x59 : [ 1, "ld", "e,c" ],
|
|
|
|
0x5a : [ 1, "ld", "e,d" ],
|
|
|
|
0x5b : [ 1, "ld", "e,e" ],
|
|
|
|
0x5c : [ 1, "ld", "e,h" ],
|
|
|
|
0x5d : [ 1, "ld", "e,l" ],
|
|
|
|
0x5e : [ 1, "ld", "e,indhl" ],
|
|
|
|
0x5f : [ 1, "ld", "e,a" ],
|
|
|
|
|
|
|
|
0x60 : [ 1, "ld", "h,b" ],
|
|
|
|
0x61 : [ 1, "ld", "h,c" ],
|
|
|
|
0x62 : [ 1, "ld", "h,d" ],
|
|
|
|
0x63 : [ 1, "ld", "h,e" ],
|
|
|
|
0x64 : [ 1, "ld", "h,h" ],
|
|
|
|
0x65 : [ 1, "ld", "h,l" ],
|
|
|
|
0x66 : [ 1, "ld", "h,indhl" ],
|
|
|
|
0x67 : [ 1, "ld", "h,a" ],
|
|
|
|
0x68 : [ 1, "ld", "l,b" ],
|
|
|
|
0x69 : [ 1, "ld", "l,c" ],
|
|
|
|
0x6a : [ 1, "ld", "l,d" ],
|
|
|
|
0x6b : [ 1, "ld", "l,e" ],
|
|
|
|
0x6c : [ 1, "ld", "l,h" ],
|
|
|
|
0x6d : [ 1, "ld", "l,l" ],
|
|
|
|
0x6e : [ 1, "ld", "l,indhl" ],
|
|
|
|
0x6f : [ 1, "ld", "l,a" ],
|
|
|
|
|
|
|
|
0x70 : [ 1, "ld", "indhl,b" ],
|
|
|
|
0x71 : [ 1, "ld", "indhl,c" ],
|
2015-06-25 23:35:39 +00:00
|
|
|
0x72 : [ 1, "ld", "indhl,d" ],
|
|
|
|
0x73 : [ 1, "ld", "indhl,e" ],
|
|
|
|
0x74 : [ 1, "ld", "indhl,h" ],
|
|
|
|
0x75 : [ 1, "ld", "indhl,l" ],
|
|
|
|
0x76 : [ 1, "halt", "implied" ],
|
|
|
|
0x77 : [ 1, "ld", "indhl,a" ],
|
|
|
|
0x78 : [ 1, "ld", "a,b" ],
|
|
|
|
0x79 : [ 1, "ld", "a,c" ],
|
|
|
|
0x7a : [ 1, "ld", "a,d" ],
|
|
|
|
0x7b : [ 1, "ld", "a,e" ],
|
|
|
|
0x7c : [ 1, "ld", "a,h" ],
|
|
|
|
0x7d : [ 1, "ld", "a,l" ],
|
|
|
|
0x7e : [ 1, "ld", "a,indhl" ],
|
|
|
|
0x7f : [ 1, "ld", "a,a" ],
|
|
|
|
|
|
|
|
0x80 : [ 1, "add", "a,b" ],
|
|
|
|
0x81 : [ 1, "add", "a,c" ],
|
|
|
|
0x82 : [ 1, "add", "a,d" ],
|
|
|
|
0x83 : [ 1, "add", "a,e" ],
|
|
|
|
0x84 : [ 1, "add", "a,h" ],
|
|
|
|
0x85 : [ 1, "add", "a,l" ],
|
|
|
|
0x86 : [ 1, "add", "a,indhl" ],
|
|
|
|
0x87 : [ 1, "add", "a,a" ],
|
|
|
|
0x88 : [ 1, "adc", "a,b" ],
|
|
|
|
0x89 : [ 1, "adc", "a,c" ],
|
|
|
|
0x8a : [ 1, "adc", "a,d" ],
|
|
|
|
0x8b : [ 1, "adc", "a,e" ],
|
|
|
|
0x8c : [ 1, "adc", "a,h" ],
|
|
|
|
0x8d : [ 1, "adc", "a,l" ],
|
|
|
|
0x8e : [ 1, "adc", "a,indhl" ],
|
|
|
|
0x8f : [ 1, "adc", "a,a" ],
|
|
|
|
|
|
|
|
0x90 : [ 1, "sub", "b" ],
|
|
|
|
0x91 : [ 1, "sub", "c" ],
|
|
|
|
0x92 : [ 1, "sub", "d" ],
|
|
|
|
0x93 : [ 1, "sub", "e" ],
|
|
|
|
0x94 : [ 1, "sub", "h" ],
|
|
|
|
0x95 : [ 1, "sub", "l" ],
|
|
|
|
0x96 : [ 1, "sub", "indhl" ],
|
|
|
|
0x97 : [ 1, "sub", "a" ],
|
|
|
|
0x98 : [ 1, "sbc", "a,b" ],
|
|
|
|
0x99 : [ 1, "sbc", "a,c" ],
|
|
|
|
0x9a : [ 1, "sbc", "a,d" ],
|
|
|
|
0x9b : [ 1, "sbc", "a,e" ],
|
|
|
|
0x9c : [ 1, "sbc", "a,h" ],
|
|
|
|
0x9d : [ 1, "sbc", "a,l" ],
|
|
|
|
0x9e : [ 1, "sbc", "a,indhl" ],
|
|
|
|
0x9f : [ 1, "sbc", "a,a" ],
|
|
|
|
|
|
|
|
0xa0 : [ 1, "and", "b" ],
|
|
|
|
0xa1 : [ 1, "and", "c" ],
|
|
|
|
0xa2 : [ 1, "and", "d" ],
|
|
|
|
0xa3 : [ 1, "and", "e" ],
|
|
|
|
0xa4 : [ 1, "and", "h" ],
|
|
|
|
0xa5 : [ 1, "and", "l" ],
|
|
|
|
0xa6 : [ 1, "and", "indhl" ],
|
|
|
|
0xa7 : [ 1, "and", "a" ],
|
|
|
|
0xa8 : [ 1, "xor", "b" ],
|
|
|
|
0xa9 : [ 1, "xor", "c" ],
|
|
|
|
0xaa : [ 1, "xor", "d" ],
|
|
|
|
0xab : [ 1, "xor", "e" ],
|
|
|
|
0xac : [ 1, "xor", "h" ],
|
|
|
|
0xad : [ 1, "xor", "l" ],
|
|
|
|
0xae : [ 1, "xor", "indhl" ],
|
|
|
|
0xaf : [ 1, "xor", "a" ],
|
|
|
|
|
|
|
|
0xb0 : [ 1, "or", "b" ],
|
|
|
|
0xb1 : [ 1, "or", "c" ],
|
|
|
|
0xb2 : [ 1, "or", "d" ],
|
|
|
|
0xb3 : [ 1, "or", "e" ],
|
|
|
|
0xb4 : [ 1, "or", "h" ],
|
|
|
|
0xb5 : [ 1, "or", "l" ],
|
|
|
|
0xb6 : [ 1, "or", "indhl" ],
|
|
|
|
0xb7 : [ 1, "or", "a" ],
|
|
|
|
0xb8 : [ 1, "cp", "b" ],
|
|
|
|
0xb9 : [ 1, "cp", "c" ],
|
|
|
|
0xba : [ 1, "cp", "d" ],
|
|
|
|
0xbb : [ 1, "cp", "e" ],
|
|
|
|
0xbc : [ 1, "cp", "h" ],
|
|
|
|
0xbd : [ 1, "cp", "l" ],
|
|
|
|
0xbe : [ 1, "cp", "indhl" ],
|
|
|
|
0xbf : [ 1, "cp", "a" ],
|
|
|
|
|
|
|
|
# [ "ret nz", 1 ], # c0
|
|
|
|
# [ "pop bc", 1 ], # c1
|
|
|
|
# [ "jp nz,", 3 ], # c2
|
|
|
|
# [ "jp ", 3 ], # c3
|
|
|
|
# [ "call nz,", 3 ], # c4
|
|
|
|
# [ "push bc", 1 ], # c5
|
|
|
|
# [ "ada a,", 2 ], # c6
|
|
|
|
# [ "rst 00", 1 ], # c7
|
|
|
|
# [ "ret z", 1 ], # c8
|
|
|
|
# [ "ret", 1 ], # c9
|
|
|
|
# [ "jp z,", 3 ], # ca
|
|
|
|
# [ "prefix", 2 ], # cb
|
|
|
|
# [ "call z,", 3 ], # cc
|
|
|
|
# [ "call ", 3 ], # cd
|
|
|
|
# [ "adc a,", 2 ], # ce
|
|
|
|
# [ "rst 08", 1 ], # cf
|
2015-06-24 02:59:44 +00:00
|
|
|
#
|
|
|
|
# [ "ret nc", 1 ], # D0
|
|
|
|
# [ "pop de", 1 ], # D1
|
|
|
|
# [ "jp nc,", 3 ], # D2
|
|
|
|
# [ "out (", 2 ], # D3 then append "),a"
|
|
|
|
# [ "call nc,", 3 ], # D4
|
|
|
|
# [ "push de", 1 ], # D5
|
|
|
|
# [ "sub ", 2 ], # D6
|
|
|
|
# [ "rst 10", 1 ], # D7
|
|
|
|
# [ "ret c", 1 ], # D8
|
|
|
|
# [ "exx", 1 ], # D9
|
|
|
|
# [ "jp c,", 3 ], # DA
|
|
|
|
# [ "in a,(", 2 ], # DB then append ")"
|
|
|
|
# [ "call c,", 3 ], # DC
|
|
|
|
# [ "prefix", 2 ], # DD
|
|
|
|
# [ "sbc a,", 2 ], # DE
|
|
|
|
# [ "rst 18", 1 ], # DF
|
|
|
|
#
|
|
|
|
# [ "ret po", 1 ], # E0
|
|
|
|
# [ "pop hl", 1 ], # E1
|
|
|
|
# [ "jp po,", 3 ], # E2
|
|
|
|
# [ "ex (sp),hl", 1 ],# E3
|
|
|
|
# [ "call po,", 3 ], # E4
|
|
|
|
# [ "push hl", 1 ], # E5
|
|
|
|
# [ "and ", 2 ], # E6
|
|
|
|
# [ "rst 20", 1 ], # E7
|
|
|
|
# [ "ret pe", 1 ], # E8
|
|
|
|
# [ "jp (hl)", 1 ], # E9
|
|
|
|
# [ "jp pe,", 3 ], # EA
|
|
|
|
# [ "ex de,hl", 1 ], # EB
|
|
|
|
# [ "call pe,", 3 ], # EC
|
|
|
|
# [ "prefix", 2 ], # ED
|
|
|
|
# [ "xor ", 2 ], # EE
|
|
|
|
# [ "rst 28", 1 ], # EF
|
|
|
|
#
|
|
|
|
# [ "ret p", 1 ], # F0
|
|
|
|
# [ "pop af", 1 ], # F1
|
|
|
|
# [ "jp p,", 3 ], # F2
|
|
|
|
# [ "di", 1 ], # F3
|
|
|
|
# [ "call p,", 3 ], # F4
|
|
|
|
# [ "push af", 1 ], # F5
|
|
|
|
# [ "or ", 2 ], # F6
|
|
|
|
# [ "rst 30", 1 ], # F7
|
|
|
|
# [ "ret m", 1 ], # F8
|
|
|
|
# [ "ld sp,phl", 1 ], # F9
|
|
|
|
# [ "jp m,", 3 ], # FA
|
|
|
|
# [ "ei", 1 ], # FB
|
|
|
|
# [ "call m,", 3 ], # FC
|
|
|
|
# [ "prefix", 2 ], # FD
|
|
|
|
# [ "cp ", 2 ], # FE
|
|
|
|
# [ "rst 38", 1 ], # FF
|
|
|
|
#
|
|
|
|
|
2015-06-25 02:41:15 +00:00
|
|
|
# Multibyte instructions
|
|
|
|
|
|
|
|
0xcb00 : [ 2, "rlc", "b" ],
|
|
|
|
|
2015-06-24 02:59:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# End of processor specific code
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
|
|
|
|
## Lookup table for multibyte instructions starting with 0xCB
|
|
|
|
#lookupTableCB = [
|
|
|
|
# [ "rlc b", 2 ], # 00
|
|
|
|
# [ "rlc c", 2 ], # 01
|
|
|
|
# [ "rlc d", 2 ], # 02
|
|
|
|
# [ "rlc e", 2 ], # 03
|
|
|
|
# [ "rlc h", 2 ], # 04
|
|
|
|
# [ "rlc l", 2 ], # 05
|
|
|
|
# [ "rlc (hl)", 2 ], # 06
|
|
|
|
# [ "rlc a", 2 ], # 07
|
|
|
|
# [ "rrc b", 2 ], # 08
|
|
|
|
# [ "rrc c", 2 ], # 09
|
|
|
|
# [ "rrc d", 2 ], # 0A
|
|
|
|
# [ "rrc e", 2 ], # 0B
|
|
|
|
# [ "rrc h", 2 ], # 0C
|
|
|
|
# [ "rrc l", 2 ], # 0D
|
|
|
|
# [ "rrc (hl)", 2 ], # 0E
|
|
|
|
# [ "rrc a", 2 ], # 0F
|
|
|
|
#
|
|
|
|
# [ "rl b", 2 ], # 10
|
|
|
|
# [ "rl c", 2 ], # 11
|
|
|
|
# [ "rl d", 2 ], # 12
|
|
|
|
# [ "rl e", 2 ], # 13
|
|
|
|
# [ "rl h", 2 ], # 14
|
|
|
|
# [ "rl l", 2 ], # 15
|
|
|
|
# [ "rl (hl)", 2 ], # 16
|
|
|
|
# [ "rl a", 2 ], # 17
|
|
|
|
# [ "rr b", 2 ], # 18
|
|
|
|
# [ "rr c", 2 ], # 19
|
|
|
|
# [ "rr d", 2 ], # 1A
|
|
|
|
# [ "rr e", 2 ], # 1B
|
|
|
|
# [ "rr h", 2 ], # 1C
|
|
|
|
# [ "rr l", 2 ], # 1D
|
|
|
|
# [ "rr (hl)", 2 ], # 1E
|
|
|
|
# [ "rr e", 2 ], # 1F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # 2F
|
|
|
|
#
|
|
|
|
# [ "", 2 ], # 20
|
|
|
|
# [ "", 2 ], # 21
|
|
|
|
# [ "", 2 ], # 22
|
|
|
|
# [ "", 2 ], # 23
|
|
|
|
# [ "", 2 ], # 24
|
|
|
|
# [ "", 2 ], # 25
|
|
|
|
# [ "", 2 ], # 26
|
|
|
|
# [ "", 2 ], # 27
|
|
|
|
# [ "", 2 ], # 28
|
|
|
|
# [ "", 2 ], # 29
|
|
|
|
# [ "", 2 ], # 2A
|
|
|
|
# [ "", 2 ], # 2B
|
|
|
|
# [ "", 2 ], # 2C
|
|
|
|
# [ "", 2 ], # 2D
|
|
|
|
# [ "", 2 ], # 2E
|
|
|
|
# [ "", 2 ], # FF
|
|
|
|
#]
|
|
|
|
#
|