-
Notifications
You must be signed in to change notification settings - Fork 1
/
opcodes.py
35 lines (34 loc) · 7.7 KB
/
opcodes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
opcodes = {0x0: 'NOP', 0x01: 'LDBCA16', 0x02: 'LDHBCA', 0x3: 'INCBC', 0x4: 'INCB', 0x5: 'DECB', 0x6: 'LDB', 0x7: 'RLCA', 0x8: 'LDA16SP', 0x9: 'ADDHLBC', 0xa: 'LDABC', 0xb:'DECBC', 0xc: 'INCC', 0xd: 'DECC', 0xe: 'LDC', 0xf: 'RRCA', #check
0x10: 'STOP', 0x11: 'LDDED16', 0x12: 'LDHDEA', 0x13: 'INCDE', 0x14: 'INCD', 0x15: 'DECD', 0x16: 'LDD', 0x17: 'RLA', 0x18: 'JR', 0x19:'ADDHLDE', 0x1a: 'LDADE', 0x1b: 'DECDE', 0x1c: 'INCE', 0x1d: 'DECE', 0x1e: 'LDE', 0x1f: 'RRA', #check
0x20: 'JRNZ', 0x21: 'LDHL16', 0x22: 'LDHL+A', 0x23: 'INCHL', 0x24: 'INCH', 0x25: 'DECH', 0x26: 'LDHA8', 0x27: 'DAA', 0x28: 'JRZ', 0x29:'ADDHLHL', 0x2a: 'LDAHL+', 0x2b: 'DECHL', 0x2c: 'INCL', 0x2d: 'DECL', 0x2e: 'LDL', 0x2f: 'CPLM', #check
0x30: 'JRNCR8', 0x31: 'LDSP16', 0x32: 'LDHL-A', 0x33: 'INCSP', 0x34: 'INCHHL', 0x35: 'DECHHL', 0x36: 'LDHLA8', 0x37: 'SCF', 0x38: 'JRCR8', 0x39: 'ADDHLSP', 0x3a: 'LDAHL-', 0x3b: 'DECSP', 0x3c: 'INCA', 0x3d: 'DECA', 0x3e: 'LDA', 0x3f: 'CCF', #check
0x40: 'LDBB', 0x41: 'LDBC', 0x42: 'LDBD', 0x43: 'LDBE', 0x44: 'LDBH', 0x45: 'LDBL', 0x46:'LDBHL', 0x47: 'LDBA', 0x48: 'LDCB', 0x49: 'LDCC', 0x4a: 'LDCD', 0x4b: 'LDCE', 0x4c: 'LDCH', 0x4d: 'LDCL', 0x4e: 'LDCHL', 0x4f: 'LDCA', #check
0x50: 'LDDB', 0x51: 'LDDC', 0x52: 'LDDD', 0x53: 'LDDE', 0x54: 'LDDH', 0x55: 'LDDL', 0x56: 'LDDHL', 0x57: 'LDDA', 0x58: 'LDEB', 0x59: 'LDEC', 0x5a: 'LDED', 0x5b: 'LDEE', 0x5c: 'LDEH', 0x5d: 'LDEL', 0x5e: 'LDEHL', 0x5f: 'LDEA', #check
0x60: 'LDHB', 0x61: 'LDHC', 0x62: 'LDHD', 0x63: 'LDHE', 0x64: 'LDHH', 0x65: 'LDHL', 0x66: 'LDHHL', 0x67: 'LDHA', 0x68: 'LDLB', 0x69: 'LDLC', 0x6a: 'LDLD', 0x6b: 'LDLE', 0x6c: 'LDLH', 0x6d: 'LDLL', 0x6e: 'LDLHL', 0x6f: 'LDLA', #check
0x70: 'LDHLB', 0x71: 'LDHLC', 0x72: 'LDHLD', 0x73: 'LDHLE', 0x74: 'LDHLH', 0x75: 'LDHLL', 0x76: 'HALT', 0x77: 'LDHLA', 0x78: 'LDAB', 0x79: 'LDAC', 0x7a: 'LDAD', 0x7b: 'LDAE', 0x7c: 'LDAH', 0x7d: 'LDAL', 0x7e: 'LDAHL', 0x7f: 'LDAA', #check
0x80: 'ADDAB', 0x81: 'ADDAC', 0x82: 'ADDAD', 0x83: 'ADDAE', 0x84: 'ADDAH', 0x85: 'ADDAL', 0x86: 'ADDAHL', 0x87: 'ADDAA', 0x88: 'ADCAB', 0x89: 'ADCAC', 0x8a: 'ADCAD', 0x8b: 'ADCAE', 0x8c: 'ADCAH', 0x8d: 'ADCAL', 0x8e: 'ADCAHL', 0x8f: 'ADCAA', #check
0x90: 'SUBB', 0x91: 'SUBC', 0x92: 'SUBD', 0x93: 'SUBE', 0x94: 'SUBH', 0x95: 'SUBL', 0x96: 'SUBHL', 0x97: 'SUBA', 0x98: 'SBCAB', 0x99: 'SBCAC', 0x9a: 'SBCAD', 0x9b: 'SBCAE', 0x9c: 'SBCAH', 0x9d: 'SBCAL', 0x9e: 'SBCAHL', 0x9f: 'SBCAA', #check
0xa0: 'ANDB', 0xa1: 'ANDC', 0xa2: 'ANDD', 0xa3: 'ANDE', 0xa4: 'ANDH', 0xa5: 'ANDL', 0xa6: 'ANDHL', 0xa7: 'ANDA', 0xa8: 'XORB', 0xa9: 'XORC', 0xaa: 'XORD', 0xab: 'XORE', 0xac: 'XORH', 0xad: 'XORL', 0xae: 'XORHL', 0xaf: 'XORA', #check
0xb0: 'ORB', 0xb1: 'ORC', 0xb2: 'ORD', 0xb3: 'ORE', 0xb4: 'ORH', 0xb5: 'ORL', 0xb6: 'ORHL', 0xb7: 'ORA', 0xb8: 'CPB', 0xb9: 'CPC', 0xba: 'CPD', 0xbb: 'CPE', 0xbc: 'CPH', 0xbd: 'CPL', 0xbe: 'CPHL', 0xbf: 'CPA', #check
0xc0: 'RETNZ', 0xc1: 'POPBC', 0xc2: 'JPNZA16', 0xc3: 'JP', 0xc4: 'CALLNZA16', 0xc5: 'PUSHBC', 0xc6: 'ADDA8', 0xc7: 'RST00H', 0xc8: 'RETZ', 0xc9: 'RET', 0xca: 'JPZA16', 0xcb: 'PREFCB', 0xcc: 'CALLZA16', 0xcd: 'CALLA16', 0xce: 'ADCAA8', 0xcf: 'RST08H', #check
0xd0: 'RETNC', 0xd1:'POPDE', 0xd2: 'JPNCA16', 0xd4: 'CALLNCA16', 0xd5: 'PUSHDE', 0xd6: 'SUBA8', 0xd7: 'RST10H', 0xd8: 'RETC', 0xd9: 'RETI', 0xda: 'JPCA16', 0xdc: 'CALLCA16', 0xde: 'SBCA8', 0xdf: 'RST18H', #check
0xe0: 'LDHA8A', 0xe1:'POPHL', 0xe2: 'LDHCA', 0xe5: 'PUSHHL', 0xe6: 'ANDA8', 0xe7: 'RST20H', 0xe8: 'ADDSPR8', 0xe9: 'JPHL', 0xea: 'LDA16A', 0xee: 'XORA8', 0xef: 'RST28H', #check
0xf0: 'LDHAA8', 0xf1: 'POPAF', 0xf2: 'LDAHC', 0xf3: 'DI', 0xf5: 'PUSHAF', 0xf6: 'ORA8', 0xf7: 'RST30H', 0xf8: 'LDHLSPR8', 0xf9: 'LDSPHL', 0xfa: 'LDAA16', 0xfb:'EI', 0xfe: 'CP', 0xff: 'RST38H'} #check
extra_opcodes = {
0x00: 'RLCB', 0x01: 'RLCC', 0x02: 'RLCD', 0x03: 'RLCE', 0x04: 'RLCH', 0x05: 'RLCL', 0x06: 'RLCHL', 0x07: 'RLCA', 0x08: 'RRCB', 0x09: 'RRCC', 0x0a: 'RRCD', 0x0b: 'RRCE', 0x0c: 'RRCH', 0x0d: 'RRCL', 0x0e: 'RRCHL', 0x0f: 'RRCA', #check
0x10: "RLB", 0x11: "RLC", 0x12: "RLD", 0x13: "RLE", 0x14: "RLH", 0x15: "RLL", 0x16: "RLHL", 0x17: "RLA", 0x18: "RRB", 0x19: "RRC", 0x1a: "RRD", 0x1b: "RRE", 0x1c: "RRH", 0x1d: "RRL", 0x1e: "RRHL", 0x1f: "RRA", #check
0x20: "SLAB", 0x21: "SLAC", 0x22: "SLAD", 0x23: "SLAE", 0x24: "SLAH", 0x25: "SLAL", 0x26: "SLAHL", 0x27: "SLAA", 0x28: "SRAB", 0x29: "SRAC", 0x2a: "SRAD", 0x2b: "SRAE", 0x2c: "SRAH", 0x2d: "SRAL", 0x2e: "SRAHL", 0x2f: "SRAA", #check
0x30: "SWAPB", 0x31: "SWAPC", 0x32: "SWAPD", 0x33: "SWAPE", 0x34: "SWAPH", 0x35: "SWAPL", 0x36: "SWAPHL", 0x37: "SWAPA", 0x38: "SRLB", 0x39: "SRLC", 0x3a: "SRLD", 0x3b: "SRLE", 0x3c: "SRLH", 0x3d: "SRLL", 0x3e: "SRLHL", 0x3f: "SRLA", #check
0x40: "BIT0B", 0x41: "BIT0C", 0x42: "BIT0D", 0x43: "BIT0E", 0x44: "BIT0H", 0x45: "BIT0L", 0x46: "BIT0HL", 0x47: "BIT0A", 0x48: "BIT1B", 0x49: "BIT1C", 0x4a: "BIT1D", 0x4b: "BIT1E", 0x4c: "BIT1H", 0x4d: "BIT1L", 0x4e: "BIT1HL", 0x4f: "BIT1A", #check
0x50: "BIT2B", 0x51: "BIT2C", 0x52: "BIT2D", 0x53: "BIT2E", 0x54: "BIT2H", 0x55: "BIT2L", 0x56: "BIT2HL", 0x57: "BIT2A", 0x58: "BIT3B", 0x59: "BIT3C", 0x5a: "BIT3D", 0x5b: "BIT3E", 0x5c: "BIT3H", 0x5d: "BIT3L", 0x5e: "BIT3HL", 0x5f: "BIT3A", #check
0x60: "BIT4B", 0x61: "BIT4C", 0x62: "BIT4D", 0x63: "BIT4E", 0x64: "BIT4H", 0x65: "BIT4L", 0x66: "BIT4HL", 0x67: "BIT4A", 0x68: "BIT5B", 0x69: "BIT5C", 0x6a: "BIT5D", 0x6b: "BIT5E", 0x6c: "BIT5H", 0x6d: "BIT5L", 0x6e: "BIT5HL", 0x6f: "BIT5A", #check
0x70: "BIT6B", 0x71: "BIT6C", 0x72: "BIT6D", 0x73: "BIT6E", 0x74: "BIT6H", 0x75: "BIT6L", 0x76: "BIT6HL", 0x77: "BIT6A", 0x78: "BIT7B", 0x79: "BIT7C", 0x7a: "BIT7D", 0x7b: "BIT7E", 0x7c: "BIT7H", 0x7d: "BIT7L", 0x7e: "BIT7HL", 0x7f: "BIT7A", #check
0x80: "RES0B", 0x81: "RES0C", 0x82: "RES0D", 0x83: "RES0E", 0x84: "RES0H", 0x85: "RES0L", 0x86: "RES0HL", 0x87: "RES0A", 0x88: "RES1B", 0x89: "RES1C", 0x8a: "RES1D", 0x8b: "RES1E", 0x8c: "RES1H", 0x8d: "RES1L", 0x8e: "RES1HL", 0x8f: "RES1A", #check
0x90: "RES2B", 0x91: "RES2C", 0x92: "RES2D", 0x93: "RES2E", 0x94: "RES2H", 0x95: "RES2L", 0x96: "RES2HL", 0x97: "RES2A", 0x98: "RES3B", 0x99: "RES3C", 0x9a: "RES3D", 0x9b: "RES3E", 0x9c: "RES3H", 0x9d: "RES3L", 0x9e: "RES3HL", 0x9f: "RES3A", #check
0xa0: "RES4B", 0xa1: "RES4C", 0xa2: "RES4D", 0xa3: "RES4E", 0xa4: "RES4H", 0xa5: "RES4L", 0xa6: "RES4HL", 0xa7: "RES4A", 0xa8: "RES5B", 0xa9: "RES5C", 0xaa: "RES5D", 0xab: "RES5E", 0xac: "RES5H", 0xad: "RES5L", 0xae: "RES5HL", 0xaf: "RES5A", #check
0xb0: "RES6B", 0xb1: "RES6C", 0xb2: "RES6D", 0xb3: "RES6E", 0xb4: "RES6H", 0xb5: "RES6L", 0xb6: "RES6HL", 0xb7: "RES6A", 0xb8: "RES7B", 0xb9: "RES7C", 0xba: "RES7D", 0xbb: "RES7E", 0xbc: "RES7H", 0xbd: "RES7L", 0xbe: "RES7HL", 0xbf: "RES7A", #check
0xc0: "SET0B", 0xc1: "SET0C", 0xc2: "SET0D", 0xc3: "SET0E", 0xc4: "SET0H", 0xc5: "SET0L", 0xc6: "SET0HL", 0xc7: "SET0A", 0xc8: "SET1B", 0xc9: "SET1C", 0xca: "SET1D", 0xcb: "SET1E", 0xcc: "SET1H", 0xcd: "SET1L", 0xce: "SET1HL", 0xcf: "SET1A", #check
0xd0: "SET2B", 0xd1: "SET2C", 0xd2: "SET2D", 0xd3: "SET2E", 0xd4: "SET2H", 0xd5: "SET2L", 0xd6: "SET2HL", 0xd7: "SET2A", 0xd8: "SET3B", 0xd9: "SET3C", 0xda: "SET3D", 0xdb: "SET3E", 0xdc: "SET3H", 0xdd: "SET3L", 0xde: "SET3HL", 0xdf: "SET3A", #check
0xe0: "SET4B", 0xe1: "SET4C", 0xe2: "SET4D", 0xe3: "SET4E", 0xe4: "SET4H", 0xe5: "SET4L", 0xe6: "SET4HL", 0xe7: "SET4A", 0xe8: "SET5B", 0xe9: "SET5C", 0xea: "SET5D", 0xeb: "SET5E", 0xec: "SET5H", 0xed: "SET5L", 0xee: "SET5HL", 0xef: "SET5A", #check
0xf0: "SET6B", 0xf1: "SET6C", 0xf2: "SET6D", 0xf3: "SET6E", 0xf4: "SET6H", 0xf5: "SET6L", 0xf6: "SET6HL", 0xf7: "SET6A", 0xf8: "SET7B", 0xf9: "SET7C", 0xfa: "SET7D", 0xfb: "SET7E", 0xfc: "SET7H", 0xfd: "SET7L", 0xfe: "SET7HL", 0xff: "SET7A", #check
}