32 if (bit_addr < 0x80) {
34 return (bit_addr >> 3) + 0x20;
37 return bit_addr & 0xf8;
114 #define T(op) RZ_ANALYSIS_OP_TYPE_##op
115 { 0x00, 1,
OP_NOP,
T(
NOP),
"nop", 1,
M_NONE, 0, 0, 0 },
116 { 0x01, 2,
OP_JMP,
T(
JMP),
"ajmp 0x%04x", 2,
M_ADDR11,
A_ADDR11, 0, 0 },
117 { 0x02, 2,
OP_JMP,
T(
JMP),
"ljmp 0x%04x", 3,
M_NONE,
A_ADDR16, 0, 0 },
118 { 0x03, 1,
OP_RR,
T(ROR),
"rr a", 1,
M_NONE, 0, 0, 0 },
119 { 0x04, 1,
OP_INC,
T(
ADD),
"inc a", 1,
M_NONE, 0, 0, 0 },
120 { 0x05, 1,
OP_INC,
T(
ADD),
"inc 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
121 { 0x06, 1,
OP_INC,
T(
ADD),
"inc @r%d", 1,
M_RI,
A_RI, 0, 0 },
122 { 0x08, 1,
OP_INC,
T(
ADD),
"inc r%d", 1,
M_RN,
A_RN, 0, 0 },
123 { 0x10, 2,
OP_JBC,
T(CJMP),
"jbc 0x%02x.%d, 0x%04x", 3,
M_NONE,
A_BIT,
A_OFFSET, 0 },
124 { 0x11, 2,
OP_CALL,
T(CALL),
"acall 0x%04x", 2,
M_ADDR11,
A_ADDR11, 0, 0 },
125 { 0x12, 2,
OP_CALL,
T(CALL),
"lcall 0x%04x", 3,
M_NONE,
A_ADDR16, 0, 0 },
126 { 0x13, 1,
OP_RRC,
T(ROR),
"rrc a", 1,
M_NONE, 0, 0, 0 },
127 { 0x14, 1,
OP_DEC,
T(
SUB),
"dec a", 1,
M_NONE, 0, 0, 0 },
128 { 0x15, 1,
OP_DEC,
T(
SUB),
"dec 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
141 { 0x18, 1,
OP_DEC,
T(
SUB),
"dec r%d", 1,
M_RN,
A_RN, 0, 0 },
142 { 0x20, 2,
OP_JB,
T(CJMP),
"jb 0x%02x.%d, 0x%04x", 3,
M_NONE,
A_BIT,
A_OFFSET, 0 },
143 { 0x22, 2,
OP_RET,
T(
RET),
"ret", 1,
M_NONE,
A_NONE, 0, 0 },
144 { 0x23, 1,
OP_RL,
T(ROL),
"rl a", 1,
M_NONE,
A_NONE, 0, 0 },
145 { 0x24, 1,
OP_ADD,
T(
ADD),
"add a, #0x%02x", 2,
M_NONE,
A_IMMEDIATE, 0, 0 },
146 { 0x25, 1,
OP_ADD,
T(
ADD),
"add a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
147 { 0x26, 1,
OP_ADD,
T(
ADD),
"add a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
148 { 0x28, 1,
OP_ADD,
T(
ADD),
"add a, r%d", 1,
M_RN,
A_RN, 0, 0 },
149 { 0x30, 2,
OP_JNB,
T(CJMP),
"jnb 0x%02x.%d, 0x%04x", 3,
M_NONE,
A_BIT,
A_OFFSET, 0 },
150 { 0x32, 2,
OP_RET,
T(
RET),
"reti", 1,
M_NONE, 0, 0, 0 },
151 { 0x33, 1,
OP_RLC,
T(ROR),
"rlc a", 1,
M_NONE, 0, 0, 0 },
152 { 0x34, 1,
OP_ADDC,
T(
ADD),
"addc a, #0x%02x", 2,
M_NONE,
A_IMMEDIATE, 0, 0 },
153 { 0x35, 1,
OP_ADDC,
T(
ADD),
"addc a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
154 { 0x36, 1,
OP_ADDC,
T(
ADD),
"addc a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
155 { 0x38, 1,
OP_ADDC,
T(
ADD),
"addc a, r%d", 1,
M_RN,
A_RN, 0, 0 },
156 { 0x40, 2,
OP_JC,
T(CJMP),
"jc 0x%04x", 2,
M_NONE,
A_OFFSET, 0, 0 },
157 { 0x42, 1,
OP_ORL,
T(
OR),
"orl 0x%02x, a", 2,
M_NONE,
A_DIRECT, 0, 0 },
158 { 0x43, 1,
OP_ORL,
T(
OR),
"orl 0x%02x, #0x%02x", 3,
M_NONE,
A_DIRECT,
A_IMMEDIATE, 0 },
159 { 0x44, 1,
OP_ORL,
T(
OR),
"orl a, #0x%02x", 2,
M_NONE,
A_IMMEDIATE, 0, 0 },
160 { 0x45, 1,
OP_ORL,
T(
OR),
"orl a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
161 { 0x46, 1,
OP_ORL,
T(
OR),
"orl a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
162 { 0x48, 1,
OP_ORL,
T(
OR),
"orl a, r%d", 1,
M_RN,
A_RN, 0, 0 },
163 { 0x50, 2,
OP_JNC,
T(CJMP),
"jnc 0x%04x", 2,
M_NONE,
A_OFFSET, 0, 0 },
164 { 0x52, 1,
OP_ANL,
T(
AND),
"anl 0x%02x, a", 2,
M_NONE,
A_DIRECT, 0, 0 },
165 { 0x53, 2,
OP_ANL,
T(
AND),
"anl 0x%02x, #0x%02x", 3,
M_NONE,
A_DIRECT,
A_IMMEDIATE, 0 },
166 { 0x54, 1,
OP_ANL,
T(
AND),
"anl a, #0x%02x", 2,
M_NONE,
A_IMMEDIATE, 0, 0 },
167 { 0x55, 1,
OP_ANL,
T(
AND),
"anl a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
168 { 0x56, 1,
OP_ANL,
T(
AND),
"anl a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
169 { 0x58, 1,
OP_ANL,
T(
AND),
"anl a, r%d", 1,
M_RN,
A_RN, 0, 0 },
170 { 0x60, 2,
OP_JZ,
T(CJMP),
"jz 0x%04x", 2,
M_NONE,
A_OFFSET, 0, 0 },
171 { 0x62, 1,
OP_XRL,
T(
XOR),
"xrl 0x%02x, a", 2,
M_NONE,
A_DIRECT, 0, 0 },
172 { 0x63, 2,
OP_XRL,
T(
XOR),
"xrl 0x%02x, #0x%02x", 3,
M_NONE,
A_DIRECT,
A_IMMEDIATE, 0 },
173 { 0x64, 1,
OP_XRL,
T(
XOR),
"xrl a, #0x%02x", 2,
M_NONE,
A_IMMEDIATE, 0, 0 },
174 { 0x65, 1,
OP_XRL,
T(
XOR),
"xrl a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
175 { 0x66, 1,
OP_XRL,
T(
XOR),
"xrl a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
176 { 0x68, 1,
OP_XRL,
T(
XOR),
"xrl a, r%d", 1,
M_RN,
A_RN, 0, 0 },
177 { 0x70, 2,
OP_JNZ,
T(CJMP),
"jnz 0x%04x", 2,
M_NONE,
A_OFFSET, 0, 0 },
178 { 0x72, 2,
OP_ORL,
T(
OR),
"orl c, 0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
179 { 0x73, 2,
OP_JMP,
T(UJMP),
"jmp @a+dptr", 1,
M_NONE, 0, 0, 0 },
180 { 0x74, 1,
OP_MOV,
T(MOV),
"mov a, #0x%02x", 2,
M_NONE,
A_IMMEDIATE, 0, 0 },
181 { 0x75, 2,
OP_MOV,
T(MOV),
"mov 0x%02x, #0x%02x", 3,
M_NONE,
A_DIRECT,
A_IMMEDIATE, 0 },
182 { 0x76, 1,
OP_MOV,
T(MOV),
"mov @r%d, #0x%02x", 2,
M_RI,
A_RI,
A_IMMEDIATE, 0 },
183 { 0x78, 1,
OP_MOV,
T(MOV),
"mov r%d, #0x%02x", 2,
M_RN,
A_RN,
A_IMMEDIATE, 0 },
184 { 0x80, 2,
OP_JMP,
T(
JMP),
"sjmp 0x%04x", 2,
M_NONE,
A_OFFSET, 0, 0 },
185 { 0x82, 2,
OP_ANL,
T(
AND),
"anl c, 0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
186 { 0x83, 2,
OP_MOV,
T(MOV),
"movc a, @a+pc", 1,
M_NONE, 0, 0, 0 },
187 { 0x84, 4,
OP_DIV,
T(
DIV),
"div ab", 1,
M_NONE, 0, 0, 0 },
188 { 0x85, 2,
OP_MOV,
T(MOV),
"mov 0x%02x, 0x%02x", 3,
M_NONE,
A_DIRECT,
A_DIRECT, 0 },
189 { 0x86, 2,
OP_MOV,
T(MOV),
"mov 0x%02x, @r%d", 2,
M_RI,
A_DIRECT,
A_RI, 0 },
190 { 0x88, 2,
OP_MOV,
T(MOV),
"mov 0x%02x, r%d", 2,
M_RN,
A_DIRECT,
A_RN, 0 },
191 { 0x90, 2,
OP_MOV,
T(MOV),
"mov dptr, #0x%04x", 3,
M_NONE,
A_IMM16, 0, 0 },
192 { 0x92, 2,
OP_MOV,
T(MOV),
"mov 0x%02x.%d, c", 2,
M_NONE,
A_BIT, 0, 0 },
193 { 0x93, 2,
OP_MOV,
T(MOV),
"movc a, @a+dptr", 1,
M_NONE, 0, 0, 0 },
194 { 0x94, 1,
OP_SUBB,
T(
SUB),
"subb a, #0x%02x", 2,
M_NONE,
A_IMMEDIATE, 0, 0 },
195 { 0x95, 1,
OP_SUBB,
T(
SUB),
"subb a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
196 { 0x96, 1,
OP_SUBB,
T(
SUB),
"subb a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
197 { 0x98, 1,
OP_SUBB,
T(
SUB),
"subb a, r%d", 1,
M_RN,
A_RN, 0, 0 },
198 { 0xa0, 2,
OP_ORL,
T(
OR),
"orl c, /0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
199 { 0xa2, 1,
OP_MOV,
T(MOV),
"mov c, 0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
200 { 0xa3, 2,
OP_INC,
T(
ADD),
"inc dptr", 1,
M_NONE, 0, 0, 0 },
201 { 0xa4, 4,
OP_MUL,
T(
MUL),
"mul ab", 1,
M_NONE, 0, 0, 0 },
202 { 0xa6, 2,
OP_MOV,
T(MOV),
"mov @r%d, 0x%02x", 2,
M_RI,
A_RI,
A_DIRECT, 0 },
203 { 0xa8, 2,
OP_MOV,
T(MOV),
"mov r%d, 0x%02x", 2,
M_RN,
A_RN,
A_DIRECT, 0 },
204 { 0xb0, 2,
OP_ANL,
T(
AND),
"anl c, /0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
205 { 0xb2, 1,
OP_CPL,
T(CPL),
"cpl 0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
207 { 0xb4, 2,
OP_CJNE,
T(CJMP),
"cjne a, #0x%02x, 0x%04x", 3,
M_NONE,
A_IMMEDIATE,
A_OFFSET, 0 },
208 { 0xb5, 2,
OP_CJNE,
T(CJMP),
"cjne a, 0x%02x, 0x%04x", 3,
M_NONE,
A_DIRECT,
A_OFFSET, 0 },
209 { 0xb6, 2,
OP_CJNE,
T(CJMP) |
T(IND),
"cjne @r%d, #0x%02x, 0x%04x", 3,
M_RI,
A_RI,
A_IMMEDIATE,
A_OFFSET },
210 { 0xb8, 2,
OP_CJNE,
T(CJMP),
"cjne r%d, #0x%02x, 0x%04x", 3,
M_RN,
A_RN,
A_IMMEDIATE,
A_OFFSET },
211 { 0xc0, 2,
OP_PUSH,
T(PUSH) |
T(
MEM),
"push 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
212 { 0xc2, 1,
OP_CLR,
T(IO),
"clr 0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
213 { 0xc3, 1,
OP_CLR,
T(IO),
"clr c", 1,
M_NONE, 0, 0, 0 },
214 { 0xc4, 1,
OP_SWAP,
T(XCHG),
"swap a", 1,
M_NONE, 0, 0, 0 },
215 { 0xc5, 1,
OP_XCH,
T(XCHG),
"xch a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
216 { 0xc6, 1,
OP_XCH,
T(XCHG),
"xch a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
217 { 0xc8, 1,
OP_XCH,
T(XCHG),
"xch a, r%d", 1,
M_RN,
A_RN, 0, 0 },
218 { 0xd0, 2,
OP_POP,
T(POP) |
T(
MEM),
"pop 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
219 { 0xd2, 1,
OP_SETB,
T(IO),
"setb 0x%02x.%d", 2,
M_NONE,
A_BIT, 0, 0 },
220 { 0xd3, 1,
OP_SETB,
T(IO),
"setb c", 1,
M_NONE, 0, 0, 0 },
221 { 0xd4, 1,
OP_DA,
T(
CAST),
"da a", 1,
M_NONE, 0, 0, 0 },
222 { 0xd5, 2,
OP_DJNZ,
T(CJMP),
"djnz 0x%02x, 0x%04x", 3,
M_NONE,
A_DIRECT,
A_OFFSET, 0 },
223 { 0xd6, 1,
OP_XCH,
T(XCHG),
"xchd a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
224 { 0xd8, 2,
OP_DJNZ,
T(CJMP),
"djnz r%d, 0x%04x", 2,
M_RN,
A_RN,
A_OFFSET, 0 },
225 { 0xe0, 2,
OP_MOV,
T(MOV),
"movx a, @dptr", 1,
M_NONE, 0, 0, 0 },
226 { 0xe2, 2,
OP_MOV,
T(MOV),
"movx a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
227 { 0xe4, 1,
OP_CLR,
T(IO),
"clr a", 1,
M_NONE, 0, 0, 0 },
228 { 0xe5, 1,
OP_MOV,
T(MOV),
"mov a, 0x%02x", 2,
M_NONE,
A_DIRECT, 0, 0 },
229 { 0xe6, 1,
OP_MOV,
T(MOV),
"mov a, @r%d", 1,
M_RI,
A_RI, 0, 0 },
230 { 0xe8, 1,
OP_MOV,
T(MOV),
"mov a, r%d", 1,
M_RN,
A_RN, 0, 0 },
231 { 0xf0, 2,
OP_MOV,
T(MOV),
"movx @dptr, a", 1,
M_NONE, 0, 0, 0 },
232 { 0xf2, 2,
OP_MOV,
T(MOV),
"movx @r%d, a", 1,
M_RI,
A_RI, 0, 0 },
233 { 0xf4, 1,
OP_CPL,
T(CPL),
"cpl a", 1,
M_NONE, 0, 0, 0 },
234 { 0xf5, 1,
OP_MOV,
T(MOV),
"mov 0x%02x, a", 2,
M_NONE,
A_DIRECT, 0, 0 },
235 { 0xf6, 1,
OP_MOV,
T(MOV),
"mov @r%d, a", 1,
M_RI,
A_RI, 0, 0 },
236 { 0xf8, 1,
OP_MOV,
T(MOV),
"mov r%d, a", 1,
M_RN,
A_RN, 0, 0 },
static ut64 arg_offset(ut64 bank, ut16 pc, ut8 offset)
static ut64 arg_addr11(ut64 bank, ut16 pc, const ut8 *buf)
static ut64 apply_bank(ut64 ref, ut16 addr)
Construct an address with the higher bits from ref (determining the bank) and the lower from addr (of...
static _8051_op_t _8051_ops[]
static ut8 arg_bit(ut8 bit_addr)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()