-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathop_codes.csv
More file actions
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 1.
207 lines (207 loc) · 20.7 KB
/
op_codes.csv
File metadata and controls
207 lines (207 loc) · 20.7 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
"HLT",1, 0x00 , //cpu halts cant be restarted
"NOP",1, 0x01 , //does nothing
"POP_H",1, 0x02 , //pop 8 bit a reg
"POP_L",1, 0x03 , //pop 8 bit a reg
"MOVA_L",1, 0x04 , //Move A to L no flags effected
"MOVA_H",1, 0x05 , //Move A to H no flags effected
"MOVL_A",1, 0x06 , //Move L to A no flags effected
"MOVH_A",1, 0x07 , //Move H to A no flags effected
"MOVB_H",1, 0x08 , //Move B to H no flags effected
"MOVB_L",1, 0x09 , //Move B to L no flags effected
"MOVH_B",1, 0x0a , //Move H to B no flags effected
"MOVL_B",1, 0x0b , //Move L to B no flags effected
"MOV_HL_DA",1, 0x0c , //Move HL to DA
"MOV_HL_CB",1, 0x0d , //Move HL to CB
"PUSHALL",1, 0x0e , //push all registers to stack except sp and pc
"POPALL",1, 0x0f , //pops all registers from stack except sp and pc
"DEC_A",1, 0x10 , //Decrement A flags set
"DEC_D",1, 0x11 , //Decrement B flags set
"INC_A",1, 0x12 , //Decrement A flags set
"INC_D",1, 0x13 , //Decrement D flags set
"DEC_X",1, 0x14 , //decreament 16 bit X reg flags not set
"DEC_Y",1, 0x15 , //decreament 16 bit Y reg flags not set
"INC_X",1, 0x16 , //Increament 16 bit X reg flags not set
"INC_Y",1, 0x17 , //Increament 16 bit Y reg flags not set
"ADCI_DA",3, 0x18 , //Add 16 bit mem to DA with carry
"ADC_DA_CB",1, 0x19 , //Add CB to DA with carry store result in DA
"ADD_A_L",1, 0x1a , //Add A to reg L store result in A
"ADD_A_H",1, 0x1b , //Add A to reg H store result in A
"ADC_A_L",1, 0x1c , //Add A to reg L store result in A
"ADC_A_H",1, 0x1d , //Add A to reg H store result in A
"ADC_D_C",1, 0x1e , //Add C to D
"ST_L_X",1, 0x1f , //Write L to mem with X
"ANDI_A",2, 0x20 , //And A imediate from mem
"ANDI_D",2, 0x21 , //And B imediate from mem
"ANDA_B",1, 0x22 , //A and B result in A
"ANDD_C",1, 0x23 , //D and C result in D
"ANDA_H",1, 0x24 , //A and H result in A
"ANDA_L",1, 0x25 , //A and L result in A
"ANDDA_CB",1, 0x26 , //AD and CB result in DA
"SLL_A",1, 0x27 , //shift left A by value in B result in A carry flag uneffected.
"SLR_A",1, 0x28 , //shift right A by value in B result in A carry flag effected.
"SLL_D",1, 0x29 , //shift left D result in D carry flag uneffected.
"SLR_D",1, 0x2a , //shift right D result in D carry flag effected.
"ORDA_CB",1, 0x2b , //AD and CB result in DA
"ANDI_DA",3, 0x2c , //AD with MEM result in DA
"ORI_DA",3, 0x2d , //AD with MEM result in DA
"ORA_H",1, 0x2e , //A or H result in A
"ORA_L",1, 0x2f , //A or L result in A
"LDI_A",2, 0x30 , //load A immediate
"LDI_B",2, 0x31 , //load B immediate
"LDI_C",2, 0x32 , //load C immediate
"LDI_D",2, 0x33 , //load D immediate
"LD_C_X",1, 0x34 , //Load C from mem with MAR
"LD_D_X",1, 0x35 , //Load D from mem with MAR
"LD_L_X",1, 0x36 , //Load L from mem with MAR
"LDI_SP",3, 0x37 , //Write sp immediate
"LDI_X",3, 0x38 , //load X imeadiatly from mem
"LDI_Y",3, 0x39 , //load Y imeadiate
"LDX_(X)",1, 0x3a , //load mem pointed to by X
"LDY_(X)",1, 0x3b , //load mem pointed to by X
"LDX_(Y)",1, 0x3c , //load X pointer to by Y
"LDY_(Y)",1, 0x3d , //load Y pointed to by Y
"LDI_H",2, 0x3e , //load H immediate
"LDI_L",2, 0x3f , //load L immediate
"ADDI_DA",3, 0x40 , //Add 16 bit mem to DA
"ADDI_A",2, 0x41 , //Add mem location to A
"ADDI_D",2, 0x42 , //Add D imediate from mem
"ADD_A_B",1, 0x43 , //Add A to reg B store result in A
"ADD_D_C",1, 0x44 , //Add C to D
"ADD_DA_CB",1, 0x45 , //Add CB to DA store result in DA
"SUBI_A",2, 0x46 , //A - (mem location) result in A
"SUBI_D",2, 0x47 , //D - (mem location) result in D
"SUB_A_B",1, 0x48 , //A - B result in A
"SUB_D_C",1, 0x49 , //D - C result in D
"CMPI_A",2, 0x4a , //A is compared to value in memeory result in A
"CMP_A_B",1, 0x4b , //A is compared to value in B result in A
"CMP_D_C",1, 0x4c , // D is compared to C result in D
"ADCI_A",2, 0x4d , //Add with carry mem location to A store in A
"ADCI_D",2, 0x4e , //Add with carry D imediate from mem store in D
"ADC_A_B",1, 0x4f , //Add with carry A to B result in A
"MOVA_B",1, 0x50 , //Move A to B no flags effected
"MOVA_C",1, 0x51 , //Move A to C no flags effected
"MOVA_D",1, 0x52 , //Move A to D no flags effected
"MOVB_A",1, 0x53 , //Move B to A no flags effected
"MOVB_C",1, 0x54 , //Move B to C no flags effected
"MOVB_D",1, 0x55 , //Move B to D no flags effected
"MOVC_A",1, 0x56 , //Move C to A no flags effected
"MOVC_B",1, 0x57 , //Move C to B no flags effected
"MOVC_D",1, 0x58 , //Move C to D no flags effected
"MOVD_A",1, 0x59 , //Move D to A no flags effected
"MOVD_B",1, 0x5a , //Move D to B no flags effected
"MOVD_C",1, 0x5b , //Move D to C no flags effected
"MOV_SP_X",1, 0x5c , //Move stack pointer to X reg
"MOV_SP_Y",1, 0x5d , //Move stack pointer to Y reg
"MOV_SP_CB",1, 0x5e , //Move stack pointer to BC reg
"MOV_SP_HL",1, 0x5F , //Move stack pointer to hl reg
"ST_A_X",1, 0x60 , //Write A to mem with MAR
"ST_A_Y",1, 0x61 , //Write A to mem with Y
"ST_B_X",1, 0x62 , //Write B to mem with X
"ST_B_Y",1, 0x63 , //Write B to mem with Y
"ST_C_Y",1, 0x64 , //Write C to mem with Y
"ST_C_X",1, 0x65 , //Write C to mem with X
"ST_D_Y",1, 0x66 , //Write D to mem with Y
"ST_D_X",1, 0x67 , //Write D to mem with X
"LD_DA_+Y",1, 0x68 , //Load DA from mem pointed by X and inc X
"LD_DA_+X",1, 0x69 , //Load DA from mem pointed by Y and inc Y
"LD_B_X",1, 0x6A , //Load B from mem with MAR
"LD_A_X",1, 0x6b , //Load A from mem with MAR
"LD_A_+X",1, 0x6c , //Load A from mem pointed by X and inc X
"LD_A_+Y",1, 0x6d , //Load A from mem pointed by X and inc X
"ST_A_+X",1, 0x6e , //Write A to mem with MAR
"ST_A_+Y",1, 0x6f , //Write A to mem with Y
"PUSH_A",1, 0x70 , //push A
"PUSH_B",1, 0x71 , //push 8 bit B
"PUSH_C",1, 0x72 , //push 8 bit C
"PUSH_D",1, 0x73 , //push 8 bit B
"PUSH_F",1, 0x74 , //push flags
"PUSH_X",1, 0x75 , //Push the X reg
"PUSH_Y",1, 0x76 , //push the Y reg
"POP_F",1, 0x77 , //pop flags
"POP_A",1, 0x78 , //pop 8 bit a reg
"POP_B",1, 0x79 , //pop 8 bit a reg
"POP_C",1, 0x7A , //pop 8 bit a reg
"POP_Y",1, 0x7b , // bit value
"POP_X",1, 0x7C , //pops X 16 bit value
"POP_D",1, 0x7D , //pop 8 bit a reg
"PUSH_H",1, 0x7E , //push H
"PUSH_L",1, 0x7F , //push 8 bit L
"CALL",3, 0x80 , //Unconditional note PC and flags is saved
"JMP",3, 0x81 , //Unconditional Jump instruction
"JNEQ",3, 0x82 , //Jump if equal than flag set
"JPZ",3, 0x83 , //Jump if zero flag set
"J(DA)",1, 0x84 , //Unconditional Jump instruction with value in DA
"JNZ",3, 0x85 , //Jump if zero flag is not set
"JLT",3, 0x86 , //Jump if Less than flag set
"JGT",3, 0x87 , //Jump if Greater than flag set
"JEQ",3, 0x88 , //Jump if equal than flag set
"JPC",3, 0x89 , //Jump if carry than flag set
"JNEG",3, 0x8A , //Jump if negitive flag set
"JPOS",3, 0x8b , //Jump if negitive flag set
"C(DA)",1, 0x8c , //with value in DA Unconditional note PC and flags is saved
"RET",1, 0x8f , //Pops pc and restores flags
"XOR_DA_CB",1, 0x90 , //XOR DA to reg CB store result in DA
"NOT_DA",1, 0x91 , //NOT DA reg store result in DA
"XOR_A_L",1, 0x92 , //A and L result in A
"XOR_A_B",1, 0x93 , //XOR A to reg B store result in A
"XORI_A",2, 0x94 , //XOR A with memeory
"ORI_A",2, 0x95 , //OR mem location to A
"OR_A_B",1, 0x96 , //OR A with B
"NOT_A",1, 0x97 , //NOT A result in A
"SET_A",1, 0x98 , //set A set A to all ones.
"CLR_A",1, 0x99 , //clr A set A to all zeros.
"SET_D",1, 0x9a , //set A set A to all ones.
"CLR_D",1, 0x9b , //clr A set A to all zeros.
"SET_DA",1, 0x9c , //set DA set DA to all ones.
"CLR_DA",1, 0x9d , //clr DA set DA to all zeros.
"ORI_D",2, 0x9e , //OR mem location to D
"OR_D_C",1, 0x9f , //OR D with C result in D
"XOR_A_H",1, 0xA0 , //A xor H result in A
"XORI_DA",3, 0xa1 , //AD with MEM result in DA
"SBCI_A",2, 0xa3 , //A - (mem location) result in A with borrow
"SBCI_D",2, 0xa4 , //D - (mem location) result in D with borrow
"SBC_A_B",1, 0xa5 , //A - B result in A with borrow
"SBC_D_C",1, 0xa6 , //D - C result in D with borrow
"SBC_A_H",1, 0xa7 , //A - H result in A with borrow
"SBC_A_L",1, 0xa8 , //A - L result in A with borrow
"SUB_A_H",1, 0xa9 , //A - H result in A with borrow
"SUB_A_L",1, 0xaa , //A - L result in A with borrow
"SUBI_DA",3, 0xab , //DA - mem result in DA
"SBCI_DA",3, 0xac , //DA - mem result in DA with borrow
"SUB_DA_BC",3, 0xad , //DA - BC result in DA
"SBC_DA_BC",1, 0xae , //DA - BC result in DA with borrow
"CMPI_D",2, 0xaf , //D is compared to value in memeory result in D
"LD_H_X",1, 0xB0 , //Load H from mem with MAR
"MOV_CB_HL",1, 0xb1 , //Move CB to HL
"MOV_CB_DA",1, 0xb2 , //Move CB to DA
"MOV_DA_CB",1, 0xb3 , //Move DA to HL
"MOV_DA_SP",1, 0xb4 , //Move DA to SP
"MOV_DA_X",1, 0xb5 , //Move DA to X reg
"MOV_DA_Y",1, 0xb6 , //Move DA to Y
"ST_H_X",1, 0xb7 , //Write H to mem with X
"ST_H_Y",1, 0xb8 , //Write H to mem with Y
"ST_L_Y",1, 0xb9 , //Write L to mem with Y
"MOV_DA_HL",1, 0xc0 , //Move DA to HL
"LDI_HL",3, 0xc1 , //load HL immediate
"LDI_DA",3, 0xc2 , //load DA immediate
"LDI_CB",3, 0xc3 , //load CB immediate
"LD_HL_+Y",1, 0xc4 , //Load HL from mem pointed by X and inc X
"LD_HL_+X",1, 0xc5 , //Load HL from mem pointed by Y and inc Y
"LD_CB_+Y",1, 0xc6 , //Load CB from mem pointed by X and inc X
"LD_CB_+X",1, 0xc7 , //Load CB from mem pointed by Y and inc Y
"ST_HL_+Y",1, 0xc8 , //Store HL from mem pointed by X and inc X
"ST_HL_+X",1, 0xc9 , //Store HL from mem pointed by X and inc X
"ST_CB_+Y",1, 0xca , //STORE CB from mem pointed by X and inc X
"ST_CB_+X",1, 0xcb , //STORE CB from mem pointed by Y and inc Y
"XOR_D_C",1, 0xcc , //XOR D to reg D store result in D
"ST_DA_+X",1, 0xcd , //STORE CB from mem pointed by X and inc X
"ST_DA_+Y",1, 0xce , //STORE CB from mem pointed by Y and inc Y
"LD_B_+X",1, 0xd0 , //Load B from mem with MAR and inc MAR
"LD_B_+Y",1, 0xd1 , //Load B from mem with Y and inc Y
"LD_C_Y",1, 0xd2 , //Load C from mem with Y
"LD_D_Y",1, 0xd3 , //Load D from mem with Y
"LD_L_Y",1, 0xd4 , //Load L from mem with Y
"LD_H_Y",1, 0xd5 , //Load H from mem with Y
"LD_B_Y",1, 0xd6 , //Load B from mem with Y
"ST_D_+Y",1, 0xd7 , //Write D to mem with Y
"ST_D_+X",1, 0xd8 , //Write D to mem with X