91 "EQ",
"NE",
"CS",
"CC",
"MI",
"PL",
"VS",
"VC",
"HI",
"LS",
"GE",
"LT",
"GT",
"LE",
"",
"NV"
95 static uint32_t
ror(uint32_t value,
int places)
97 return (value >> places) | (value << (32 - places));
104 snprintf(instruction->
text, 128,
105 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
106 "\tUNDEFINED INSTRUCTION", address, opcode);
114 if ((opcode & 0x0d30f000) == 0x0510f000) {
120 rn = (opcode & 0xf0000) >> 16;
121 u = (opcode & 0x00800000) >> 23;
125 snprintf(instruction->
text, 128,
126 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD %s%d",
127 address, opcode, u ?
"" :
"-",
offset);
131 i = (opcode & 0x02000000) >> 25;
132 r = (opcode & 0x00400000) >> 22;
136 offset = (opcode & 0x0F80) >> 7;
142 snprintf(instruction->
text, 128,
143 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD%s [r%d, %sr%d]",
144 address, opcode, r ?
"" :
"W", rn, u ?
"" :
"-", rm);
148 shift = (opcode & 0x60) >> 5;
152 snprintf(instruction->
text, 128,
153 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD%s [r%d, %sr%d, LSL #0x%x)",
154 address, opcode, r ?
"" :
"W", rn, u ?
"" :
"-", rm,
offset);
155 }
else if (shift == 0x1) {
157 snprintf(instruction->
text, 128,
158 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD%s [r%d, %sr%d, LSR #0x%x)",
159 address, opcode, r ?
"" :
"W", rn, u ?
"" :
"-", rm,
offset);
160 }
else if (shift == 0x2) {
162 snprintf(instruction->
text, 128,
163 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD%s [r%d, %sr%d, ASR #0x%x)",
164 address, opcode, r ?
"" :
"W", rn, u ?
"" :
"-", rm,
offset);
165 }
else if (shift == 0x3) {
167 snprintf(instruction->
text, 128,
168 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD%s [r%d, %sr%d, ROR #0x%x)",
169 address, opcode, r ?
"" :
"W", rn, u ?
"" :
"-", rm,
offset);
176 snprintf(instruction->
text, 128,
177 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD%s [r%d]",
178 address, opcode, r ?
"" :
"W", rn);
180 snprintf(instruction->
text, 128,
181 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tPLD%s [r%d, #%s%d]",
182 address, opcode, r ?
"" :
"W", rn, u ?
"" :
"-",
offset);
189 if ((opcode & 0x07f000f0) == 0x05700040) {
193 switch (opcode & 0x0000000f) {
222 snprintf(instruction->
text,
224 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tDSB %s",
225 address, opcode, opt);
230 if ((opcode & 0x07f000f0) == 0x05700060) {
233 snprintf(instruction->
text,
235 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tISB %s",
237 ((opcode & 0x0000000f) == 0xf) ?
"SY" :
"UNK");
247 const char *wback = (opcode & (1 << 21)) ?
"!" :
"";
248 const char *
mode =
"";
250 switch ((opcode >> 23) & 0x3) {
265 switch (opcode & 0x0e500000) {
267 snprintf(instruction->
text, 128,
"0x%8.8" PRIx32
269 "\tSRS%s\tSP%s, #%d",
272 (
unsigned)(opcode & 0x1f));
275 snprintf(instruction->
text, 128,
"0x%8.8" PRIx32
280 (
unsigned)((opcode >> 16) & 0xf), wback);
293 snprintf(instruction->
text, 128,
294 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tSVC %#6.6" PRIx32,
295 address, opcode, (opcode & 0xffffff));
305 uint32_t target_address;
308 immediate = opcode & 0x00ffffff;
311 if (immediate & 0x00800000)
312 offset = 0xff000000 | immediate;
320 if (opcode & 0x01000000)
323 target_address = address + 8 +
offset;
325 snprintf(instruction->
text,
327 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tBLX 0x%8.8" PRIx32
"",
344 uint32_t target_address;
346 immediate = opcode & 0x00ffffff;
347 l = (opcode & 0x01000000) >> 24;
350 if (immediate & 0x00800000)
351 offset = 0xff000000 | immediate;
358 target_address = address + 8 +
offset;
365 snprintf(instruction->
text,
367 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tB%s%s 0x%8.8" PRIx32,
385 uint8_t cp_num = (opcode & 0xf00) >> 8;
388 if (((opcode & 0x0ff00000) == 0x0c400000) || ((opcode & 0x0ff00000) == 0x0c500000)) {
389 uint8_t cp_opcode, rd, rn, crm;
392 cp_opcode = (opcode & 0xf0) >> 4;
393 rd = (opcode & 0xf000) >> 12;
394 rn = (opcode & 0xf0000) >> 16;
395 crm = (opcode & 0xf);
398 if ((opcode & 0x0ff00000) == 0x0c400000) {
401 }
else if ((opcode & 0x0ff00000) == 0x0c500000) {
410 snprintf(instruction->
text, 128,
411 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
412 "\t%s%s%s p%i, %x, r%i, r%i, c%i",
413 address, opcode, mnemonic,
414 ((opcode & 0xf0000000) == 0xf0000000)
415 ?
"2" :
COND(opcode),
416 COND(opcode), cp_num, cp_opcode, rd, rn, crm);
421 char addressing_mode[32];
423 crd = (opcode & 0xf000) >> 12;
424 rn = (opcode & 0xf0000) >> 16;
425 offset = (opcode & 0xff) << 2;
428 if (opcode & 0x00100000) {
436 u = (opcode & 0x00800000) >> 23;
439 if ((opcode & 0x01200000) == 0x01000000)
440 snprintf(addressing_mode, 32,
"[r%i, #%s%d]",
441 rn, u ?
"" :
"-",
offset);
442 else if ((opcode & 0x01200000) == 0x01200000)
443 snprintf(addressing_mode, 32,
"[r%i, #%s%d]!",
444 rn, u ?
"" :
"-",
offset);
445 else if ((opcode & 0x01200000) == 0x00200000)
446 snprintf(addressing_mode, 32,
"[r%i], #%s%d",
447 rn, u ?
"" :
"-",
offset);
448 else if ((opcode & 0x01200000) == 0x00000000)
449 snprintf(addressing_mode, 32,
"[r%i], {%d}",
452 snprintf(instruction->
text, 128,
"0x%8.8" PRIx32
454 "\t%s%s%s p%i, c%i, %s",
455 address, opcode, mnemonic,
456 ((opcode & 0xf0000000) == 0xf0000000)
457 ?
"2" :
COND(opcode),
458 (opcode & (1 << 22)) ?
"L" :
"",
459 cp_num, crd, addressing_mode);
473 uint8_t cp_num, opcode_1, crd_rd, crn, crm, opcode_2;
475 cond = ((opcode & 0xf0000000) == 0xf0000000) ?
"2" :
COND(opcode);
476 cp_num = (opcode & 0xf00) >> 8;
477 crd_rd = (opcode & 0xf000) >> 12;
478 crn = (opcode & 0xf0000) >> 16;
479 crm = (opcode & 0xf);
480 opcode_2 = (opcode & 0xe0) >> 5;
483 if (opcode & 0x00000010) {
484 if (opcode & 0x00100000) {
492 opcode_1 = (opcode & 0x00e00000) >> 21;
494 snprintf(instruction->
text,
496 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s p%i, 0x%2.2x, r%i, c%i, c%i, 0x%2.2x",
511 opcode_1 = (opcode & 0x00f00000) >> 20;
513 snprintf(instruction->
text,
515 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s p%i, 0x%2.2x, c%i, c%i, c%i, 0x%2.2x",
535 uint8_t i, p, u, b, w, l;
542 i = (opcode & 0x02000000) >> 25;
543 p = (opcode & 0x01000000) >> 24;
544 u = (opcode & 0x00800000) >> 23;
545 b = (opcode & 0x00400000) >> 22;
546 w = (opcode & 0x00200000) >> 21;
547 l = (opcode & 0x00100000) >> 20;
550 rd = (opcode & 0xf000) >> 12;
553 rn = (opcode & 0xf0000) >> 16;
567 if ((p == 0) && (w == 1)) {
581 if ((p == 0) && (w == 1)) {
597 uint32_t offset_12 = (opcode & 0xfff);
599 snprintf(
offset, 32,
", #%s0x%" PRIx32
"", (u) ?
"" :
"-", offset_12);
601 snprintf(
offset, 32,
"%s",
"");
606 uint8_t shift_imm, shift;
609 shift_imm = (opcode & 0xf80) >> 7;
610 shift = (opcode & 0x60) >> 5;
614 if ((shift == 0x1) && (shift_imm == 0x0))
618 if ((shift == 0x2) && (shift_imm == 0x0))
622 if ((shift == 0x3) && (shift_imm == 0x0))
630 if ((shift_imm == 0x0) && (shift == 0x0))
631 snprintf(
offset, 32,
", %sr%i", (u) ?
"" :
"-", rm);
635 snprintf(
offset, 32,
", %sr%i, LSL #0x%x", (u) ?
"" :
"-", rm, shift_imm);
638 snprintf(
offset, 32,
", %sr%i, LSR #0x%x", (u) ?
"" :
"-", rm, shift_imm);
641 snprintf(
offset, 32,
", %sr%i, ASR #0x%x", (u) ?
"" :
"-", rm, shift_imm);
644 snprintf(
offset, 32,
", %sr%i, ROR #0x%x", (u) ?
"" :
"-", rm, shift_imm);
647 snprintf(
offset, 32,
", %sr%i, RRX", (u) ?
"" :
"-", rm);
655 snprintf(instruction->
text,
657 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, [r%i%s]",
669 snprintf(instruction->
text,
671 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, [r%i%s]!",
684 snprintf(instruction->
text,
686 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, [r%i]%s",
704 unsigned rm = (opcode >> 0) & 0xf;
705 unsigned rd = (opcode >> 12) & 0xf;
706 unsigned rn = (opcode >> 16) & 0xf;
709 switch ((opcode >> 24) & 0x3) {
714 sprintf(cp,
"UNDEFINED");
724 switch ((opcode >> 10) & 0x3) {
740 sprintf(cp,
"%cXT%s%s\tr%d, r%d%s",
741 (opcode & (1 << 22)) ?
'U' :
'S',
746 sprintf(cp,
"%cXTA%s%s\tr%d, r%d, r%d%s",
747 (opcode & (1 << 22)) ?
'U' :
'S',
760 switch ((opcode >> 20) & 0x7) {
783 switch ((opcode >> 5) & 0x7) {
812 sprintf(cp,
"%s%s%s\tr%d, r%d, r%d", prefix,
op,
COND(opcode),
813 (
int) (opcode >> 12) & 0xf,
814 (
int) (opcode >> 16) & 0xf,
815 (
int) (opcode >> 0) & 0xf);
820 sprintf(cp,
"UNDEFINED");
828 char *cp = instruction->
text;
829 char *mnemonic =
NULL;
832 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t",
837 if ((opcode & 0x01800000) == 0x00000000) {
843 if ((opcode & 0x01f00020) == 0x00800000) {
845 unsigned imm = (unsigned) (opcode >> 7) & 0x1f;
847 if (opcode & (1 << 6)) {
856 sprintf(cp,
"PKH%s%s\tr%d, r%d, r%d, %s #%d",
858 (
int) (opcode >> 12) & 0xf,
859 (
int) (opcode >> 16) & 0xf,
860 (
int) (opcode >> 0) & 0xf,
866 if ((opcode & 0x01a00020) == 0x00a00000) {
868 unsigned imm = (unsigned) (opcode >> 7) & 0x1f;
870 if (opcode & (1 << 6)) {
877 sprintf(cp,
"%cSAT%s\tr%d, #%d, r%d, %s #%d",
878 (opcode & (1 << 22)) ?
'U' :
'S',
880 (
int) (opcode >> 12) & 0xf,
881 (
int) (opcode >> 16) & 0x1f,
882 (
int) (opcode >> 0) & 0xf,
888 if ((opcode & 0x018000f0) == 0x00800070) {
894 if ((opcode & 0x01f00080) == 0x01000000) {
895 unsigned rn = (opcode >> 12) & 0xf;
898 sprintf(cp,
"SML%cD%s%s\tr%d, r%d, r%d, r%d",
899 (opcode & (1 << 6)) ?
'S' :
'A',
900 (opcode & (1 << 5)) ?
"X" :
"",
902 (
int) (opcode >> 16) & 0xf,
903 (
int) (opcode >> 0) & 0xf,
904 (
int) (opcode >> 8) & 0xf,
907 sprintf(cp,
"SMU%cD%s%s\tr%d, r%d, r%d",
908 (opcode & (1 << 6)) ?
'S' :
'A',
909 (opcode & (1 << 5)) ?
"X" :
"",
911 (
int) (opcode >> 16) & 0xf,
912 (
int) (opcode >> 0) & 0xf,
913 (
int) (opcode >> 8) & 0xf);
916 if ((opcode & 0x01f00000) == 0x01400000) {
917 sprintf(cp,
"SML%cLD%s%s\tr%d, r%d, r%d, r%d",
918 (opcode & (1 << 6)) ?
'S' :
'A',
919 (opcode & (1 << 5)) ?
"X" :
"",
921 (
int) (opcode >> 12) & 0xf,
922 (
int) (opcode >> 16) & 0xf,
923 (
int) (opcode >> 0) & 0xf,
924 (
int) (opcode >> 8) & 0xf);
927 if ((opcode & 0x01f00000) == 0x01500000) {
928 unsigned rn = (opcode >> 12) & 0xf;
930 switch (opcode & 0xc0) {
942 sprintf(cp,
"SMML%c%s%s\tr%d, r%d, r%d, r%d",
943 (opcode & (1 << 6)) ?
'S' :
'A',
944 (opcode & (1 << 5)) ?
"R" :
"",
946 (
int) (opcode >> 16) & 0xf,
947 (
int) (opcode >> 0) & 0xf,
948 (
int) (opcode >> 8) & 0xf,
951 sprintf(cp,
"SMMUL%s%s\tr%d, r%d, r%d",
952 (opcode & (1 << 5)) ?
"R" :
"",
954 (
int) (opcode >> 16) & 0xf,
955 (
int) (opcode >> 0) & 0xf,
956 (
int) (opcode >> 8) & 0xf);
961 switch (opcode & 0x01f000f0) {
965 sprintf(cp,
"%cSAT16%s\tr%d, #%d, r%d",
966 (opcode & (1 << 22)) ?
'U' :
'S',
968 (
int) (opcode >> 12) & 0xf,
969 (
int) (opcode >> 16) & 0xf,
970 (
int) (opcode >> 0) & 0xf);
983 sprintf(cp,
"SEL%s\tr%d, r%d, r%d",
COND(opcode),
984 (
int) (opcode >> 12) & 0xf,
985 (
int) (opcode >> 16) & 0xf,
986 (
int) (opcode >> 0) & 0xf);
990 if (((opcode >> 12) & 0xf) == 0xf)
991 sprintf(cp,
"USAD8%s\tr%d, r%d, r%d",
COND(opcode),
992 (
int) (opcode >> 16) & 0xf,
993 (
int) (opcode >> 0) & 0xf,
994 (
int) (opcode >> 8) & 0xf);
996 sprintf(cp,
"USADA8%s\tr%d, r%d, r%d, r%d",
COND(opcode),
997 (
int) (opcode >> 16) & 0xf,
998 (
int) (opcode >> 0) & 0xf,
999 (
int) (opcode >> 8) & 0xf,
1000 (
int) (opcode >> 12) & 0xf);
1004 unsigned rm = (opcode >> 0) & 0xf;
1005 unsigned rd = (opcode >> 12) & 0xf;
1007 sprintf(cp,
"%s%s\tr%d, r%d", mnemonic,
COND(opcode), rm, rd);
1013 sprintf(cp,
"UNDEFINED");
1021 uint8_t p, u, i, w, l, s, h;
1028 p = (opcode & 0x01000000) >> 24;
1029 u = (opcode & 0x00800000) >> 23;
1030 i = (opcode & 0x00400000) >> 22;
1031 w = (opcode & 0x00200000) >> 21;
1032 l = (opcode & 0x00100000) >> 20;
1033 s = (opcode & 0x00000040) >> 6;
1034 h = (opcode & 0x00000020) >> 5;
1037 rd = (opcode & 0xf000) >> 12;
1040 rn = (opcode & 0xf0000) >> 16;
1081 uint32_t offset_8 = ((opcode & 0xf00) >> 4) | (opcode & 0xf);
1082 snprintf(
offset, 32,
"#%s0x%" PRIx32
"", (u) ?
"" :
"-", offset_8);
1088 rm = (opcode & 0xf);
1089 snprintf(
offset, 32,
"%sr%i", (u) ?
"" :
"-", rm);
1099 snprintf(instruction->
text,
1101 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, [r%i, %s]",
1113 snprintf(instruction->
text,
1115 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, [r%i, %s]!",
1128 snprintf(instruction->
text,
1130 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, [r%i], %s",
1150 uint8_t p, u, s, w, l, rn;
1151 uint32_t register_list;
1152 char *addressing_mode;
1159 p = (opcode & 0x01000000) >> 24;
1160 u = (opcode & 0x00800000) >> 23;
1161 s = (opcode & 0x00400000) >> 22;
1162 w = (opcode & 0x00200000) >> 21;
1163 l = (opcode & 0x00100000) >> 20;
1164 register_list = (opcode & 0xffff);
1165 rn = (opcode & 0xf0000) >> 16;
1183 addressing_mode =
"IB";
1186 addressing_mode =
"DB";
1192 addressing_mode =
"";
1195 addressing_mode =
"DA";
1199 reg_list_p = reg_list;
1200 for (i = 0; i <= 15; i++) {
1201 if ((register_list >> i) & 1) {
1204 reg_list_p += snprintf(reg_list_p,
1205 (reg_list + 69 - reg_list_p),
1209 reg_list_p += snprintf(reg_list_p,
1210 (reg_list + 69 - reg_list_p),
1216 snprintf(instruction->
text, 128,
1217 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1218 "\t%s%s%s r%i%s, {%s}%s",
1220 mnemonic, addressing_mode,
COND(opcode),
1221 rn, (w) ?
"!" :
"", reg_list, (s) ?
"^" :
"");
1231 if ((opcode & 0x000000f0) == 0x00000090) {
1233 if ((opcode & 0x0f800000) == 0x00000000) {
1234 uint8_t rm, rs, rn, rd, s;
1236 rs = (opcode & 0xf00) >> 8;
1237 rn = (opcode & 0xf000) >> 12;
1238 rd = (opcode & 0xf0000) >> 16;
1239 s = (opcode & 0x00100000) >> 20;
1242 if (opcode & 0x00200000) {
1244 snprintf(instruction->
text,
1246 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tMLA%s%s r%i, r%i, r%i, r%i",
1257 snprintf(instruction->
text,
1259 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tMUL%s%s r%i, r%i, r%i",
1273 if ((opcode & 0x0f800000) == 0x00800000) {
1274 char *mnemonic =
NULL;
1275 uint8_t rm, rs, rd_hi, rd_low, s;
1277 rs = (opcode & 0xf00) >> 8;
1278 rd_hi = (opcode & 0xf000) >> 12;
1279 rd_low = (opcode & 0xf0000) >> 16;
1280 s = (opcode & 0x00100000) >> 20;
1282 switch ((opcode & 0x00600000) >> 21) {
1301 snprintf(instruction->
text,
1303 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, r%i, r%i, r%i",
1318 if ((opcode & 0x0f800000) == 0x01000000) {
1321 rd = (opcode & 0xf000) >> 12;
1322 rn = (opcode & 0xf0000) >> 16;
1327 snprintf(instruction->
text,
1329 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s r%i, r%i, [r%i]",
1332 (opcode & 0x00400000) ?
"SWPB" :
"SWP",
1348 int r = (opcode & 0x00400000) >> 22;
1349 char *PSR = (r) ?
"SPSR" :
"CPSR";
1352 if (opcode & 0x00200000) {
1356 if (opcode & 0x02000000) {
1357 uint8_t immediate = (opcode & 0xff);
1358 uint8_t rotate = (opcode & 0xf00);
1360 snprintf(instruction->
text,
1362 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tMSR%s %s_%s%s%s%s, 0x%8.8" PRIx32,
1367 (opcode & 0x10000) ?
"c" :
"",
1368 (opcode & 0x20000) ?
"x" :
"",
1369 (opcode & 0x40000) ?
"s" :
"",
1370 (opcode & 0x80000) ?
"f" :
"",
1371 ror(immediate, (rotate * 2))
1374 uint8_t rm = opcode & 0xf;
1375 snprintf(instruction->
text,
1377 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tMSR%s %s_%s%s%s%s, r%i",
1382 (opcode & 0x10000) ?
"c" :
"",
1383 (opcode & 0x20000) ?
"x" :
"",
1384 (opcode & 0x40000) ?
"s" :
"",
1385 (opcode & 0x80000) ?
"f" :
"",
1394 rd = (opcode & 0x0000f000) >> 12;
1396 snprintf(instruction->
text,
1398 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tMRS%s r%i, %s",
1414 if ((opcode & 0x000000f0) == 0x00000000)
1418 if ((opcode & 0x006000f0) == 0x00200010) {
1423 snprintf(instruction->
text, 128,
"0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tBX%s r%i",
1424 address, opcode,
COND(opcode), rm);
1431 if ((opcode & 0x006000f0) == 0x00200020) {
1436 snprintf(instruction->
text, 128,
1437 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tBXJ%s r%i",
1438 address, opcode,
COND(opcode), rm);
1445 if ((opcode & 0x006000f0) == 0x00600010) {
1449 rd = (opcode & 0xf000) >> 12;
1451 snprintf(instruction->
text,
1453 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tCLZ%s r%i, r%i",
1462 if ((opcode & 0x006000f0) == 0x00200030) {
1467 snprintf(instruction->
text, 128,
"0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tBLX%s r%i",
1468 address, opcode,
COND(opcode), rm);
1475 if ((opcode & 0x0000000f0) == 0x00000050) {
1477 char *mnemonic =
NULL;
1479 rd = (opcode & 0xf000) >> 12;
1480 rn = (opcode & 0xf0000) >> 16;
1482 switch ((opcode & 0x00600000) >> 21) {
1501 snprintf(instruction->
text,
1503 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s r%i, r%i, r%i",
1514 if ((opcode & 0x0000000f0) == 0x00000060) {
1515 if (((opcode & 0x600000) >> 21) == 3)
1517 snprintf(instruction->
text,
1519 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tERET",
1525 if ((opcode & 0x0000000f0) == 0x00000070) {
1526 uint32_t immediate = 0;
1527 char *mnemonic =
NULL;
1529 switch ((opcode & 0x600000) >> 21) {
1533 immediate = ((opcode & 0x000fff00) >> 4) | (opcode & 0xf);
1538 immediate = ((opcode & 0x000fff00) >> 4) | (opcode & 0xf);
1543 immediate = (opcode & 0xf);
1547 snprintf(instruction->
text,
1549 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s 0x%4.4" PRIx32
"",
1557 if ((opcode & 0x000000090) == 0x00000080) {
1558 int x = (opcode & 0x20) >> 5;
1559 int y = (opcode & 0x40) >> 6;
1562 if ((opcode & 0x00600000) == 0x00000000) {
1563 uint8_t rd, rm, rs, rn;
1565 rd = (opcode & 0xf0000) >> 16;
1566 rm = (opcode & 0xf);
1567 rs = (opcode & 0xf00) >> 8;
1568 rn = (opcode & 0xf000) >> 12;
1570 snprintf(instruction->
text,
1572 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tSMLA%s%s%s r%i, r%i, r%i, r%i",
1585 if ((opcode & 0x00600000) == 0x00400000) {
1586 uint8_t rd_low, rd_hi, rm, rs;
1588 rd_hi = (opcode & 0xf0000) >> 16;
1589 rd_low = (opcode & 0xf000) >> 12;
1590 rm = (opcode & 0xf);
1591 rs = (opcode & 0xf00) >> 8;
1593 snprintf(instruction->
text,
1595 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tSMLA%s%s%s r%i, r%i, r%i, r%i",
1608 if (((opcode & 0x00600000) == 0x00200000) && (x == 0)) {
1609 uint8_t rd, rm, rs, rn;
1611 rd = (opcode & 0xf0000) >> 16;
1612 rm = (opcode & 0xf);
1613 rs = (opcode & 0xf00) >> 8;
1614 rn = (opcode & 0xf000) >> 12;
1616 snprintf(instruction->
text,
1618 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tSMLAW%s%s r%i, r%i, r%i, r%i",
1630 if ((opcode & 0x00600000) == 0x00600000) {
1633 rd = (opcode & 0xf0000) >> 16;
1634 rm = (opcode & 0xf);
1635 rs = (opcode & 0xf00) >> 8;
1637 snprintf(instruction->
text,
1639 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tSMULW%s%s%s r%i, r%i, r%i",
1651 if (((opcode & 0x00600000) == 0x00200000) && (x == 1)) {
1654 rd = (opcode & 0xf0000) >> 16;
1655 rm = (opcode & 0xf);
1656 rs = (opcode & 0xf00) >> 8;
1658 snprintf(instruction->
text,
1660 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tSMULW%s%s r%i, r%i, r%i",
1681 rd = (opcode & 0xf000) >> 12;
1682 t = opcode & 0x00400000;
1683 immediate = (opcode & 0xf0000) >> 4 | (opcode & 0xfff);
1688 snprintf(instruction->
text,
1690 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tMOV%s%s r%i, #0x%" PRIx16,
1704 uint8_t i,
op, s, rn, rd;
1705 char *mnemonic =
NULL;
1706 char shifter_operand[32];
1708 i = (opcode & 0x02000000) >> 25;
1709 op = (opcode & 0x01e00000) >> 21;
1710 s = (opcode & 0x00100000) >> 20;
1712 rd = (opcode & 0xf000) >> 12;
1713 rn = (opcode & 0xf0000) >> 16;
1787 uint8_t immed_8 = opcode & 0xff;
1788 uint8_t rotate_imm = (opcode & 0xf00) >> 8;
1791 immediate =
ror(immed_8, rotate_imm * 2);
1793 snprintf(shifter_operand, 32,
"#0x%" PRIx32
"", immediate);
1799 shift = (opcode & 0x60) >> 5;
1800 rm = (opcode & 0xf);
1802 if ((opcode & 0x10) != 0x10) {
1805 shift_imm = (opcode & 0xf80) >> 7;
1814 if ((shift == 0x1) && (shift_imm == 0x0))
1818 if ((shift == 0x2) && (shift_imm == 0x0))
1822 if ((shift == 0x3) && (shift_imm == 0x0))
1825 if ((shift_imm == 0x0) && (shift == 0x0))
1826 snprintf(shifter_operand, 32,
"r%i", rm);
1829 snprintf(shifter_operand,
1834 else if (shift == 0x1)
1835 snprintf(shifter_operand,
1840 else if (shift == 0x2)
1841 snprintf(shifter_operand,
1846 else if (shift == 0x3)
1847 snprintf(shifter_operand,
1852 else if (shift == 0x4)
1853 snprintf(shifter_operand, 32,
"r%i, RRX", rm);
1856 uint8_t rs = (opcode & 0xf00) >> 8;
1864 snprintf(shifter_operand, 32,
"r%i, LSL r%i", rm, rs);
1865 else if (shift == 0x1)
1866 snprintf(shifter_operand, 32,
"r%i, LSR r%i", rm, rs);
1867 else if (shift == 0x2)
1868 snprintf(shifter_operand, 32,
"r%i, ASR r%i", rm, rs);
1869 else if (shift == 0x3)
1870 snprintf(shifter_operand, 32,
"r%i, ROR r%i", rm, rs);
1874 if ((
op < 0x8) || (
op == 0xc) || (
op == 0xe)) {
1876 snprintf(instruction->
text,
1878 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, r%i, %s",
1887 }
else if ((
op == 0xd) || (
op == 0xf)) {
1889 if (opcode == 0xe1a00000)
1890 snprintf(instruction->
text,
1892 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tNOP",
1896 snprintf(instruction->
text,
1898 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s%s r%i, %s",
1907 snprintf(instruction->
text, 128,
"0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\t%s%s r%i, %s",
1908 address, opcode, mnemonic,
COND(opcode),
1909 rn, shifter_operand);
1920 instruction->
opcode = opcode;
1924 if ((opcode & 0xf0000000) == 0xf0000000) {
1926 if ((opcode & 0x08000000) == 0x00000000)
1930 if ((opcode & 0x0e000000) == 0x08000000)
1934 if ((opcode & 0x0e000000) == 0x0a000000)
1939 if ((opcode & 0x0e000000) == 0x0c000000)
1943 if ((opcode & 0x0f000100) == 0x0c000000)
1947 if ((opcode & 0x0f000010) == 0x0c000010)
1951 if ((opcode & 0x0f000000) == 0x0f000000) {
1953 snprintf(instruction->
text,
1955 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
1963 if ((opcode & 0x0e000000) == 0x00000000) {
1965 if ((opcode & 0x00000090) == 0x00000090)
1969 if ((opcode & 0x0f900000) == 0x01000000)
1976 if ((opcode & 0x0e000000) == 0x02000000) {
1978 if ((opcode & 0x0fb00000) == 0x03000000)
1982 if ((opcode & 0x0fb00000) == 0x03200000)
1990 if ((opcode & 0x0e000000) == 0x04000000) {
1996 if ((opcode & 0x0e000000) == 0x06000000) {
1998 if ((opcode & 0x00000010) == 0x00000000)
2004 if ((opcode & 0x07f000f0) == 0x07f000f0) {
2006 snprintf(instruction->
text, 128,
2007 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEF",
2017 if ((opcode & 0x0e000000) == 0x08000000) {
2023 if ((opcode & 0x0e000000) == 0x0a000000) {
2029 if ((opcode & 0x0e000000) == 0x0c000000) {
2035 if ((opcode & 0x0e000000) == 0x0e000000) {
2037 if ((opcode & 0x0f000000) == 0x0f000000)
2041 if ((opcode & 0x0f000010) == 0x0e000000)
2045 if ((opcode & 0x0f000010) == 0x0e000010)
2049 LOG_ERROR(
"ARM: should never reach this point (opcode=%08x)",
2057 uint32_t
offset = opcode & 0x7ff;
2058 uint32_t opc = (opcode >> 11) & 0x3;
2059 uint32_t target_address;
2060 char *mnemonic =
NULL;
2063 if (((opc == 0) || (opc == 2)) && (
offset & 0x00000400))
2066 target_address = address + 4 + (
offset << 1);
2078 target_address &= 0xfffffffc;
2083 mnemonic =
"prefix";
2084 target_address =
offset << 12;
2102 snprintf(instruction->
text, 128,
2103 "0x%8.8" PRIx32
" 0x%4.4x \t%s\t%#8.8" PRIx32,
2104 address, opcode, mnemonic, target_address);
2115 uint8_t rd = (opcode >> 0) & 0x7;
2116 uint8_t rn = (opcode >> 3) & 0x7;
2117 uint8_t rm_imm = (opcode >> 6) & 0x7;
2118 uint32_t opc = opcode & (1 << 9);
2119 uint32_t reg_imm = opcode & (1 << 10);
2138 snprintf(instruction->
text, 128,
2139 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tr%i, r%i, #%d",
2140 address, opcode, mnemonic, rd, rn, rm_imm);
2144 snprintf(instruction->
text, 128,
2145 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tr%i, r%i, r%i",
2146 address, opcode, mnemonic, rd, rn, rm_imm);
2155 uint8_t rd = (opcode >> 0) & 0x7;
2156 uint8_t rm = (opcode >> 3) & 0x7;
2157 uint8_t imm = (opcode >> 6) & 0x1f;
2158 uint8_t opc = (opcode >> 11) & 0x3;
2159 char *mnemonic =
NULL;
2179 if ((imm == 0) && (opc != 0))
2190 snprintf(instruction->
text, 128,
2191 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tr%i, r%i, #%#2.2x",
2192 address, opcode, mnemonic, rd, rm, imm);
2200 uint8_t imm = opcode & 0xff;
2201 uint8_t rd = (opcode >> 8) & 0x7;
2202 uint32_t opc = (opcode >> 11) & 0x3;
2203 char *mnemonic =
NULL;
2232 snprintf(instruction->
text, 128,
2233 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tr%i, #%#2.2x",
2234 address, opcode, mnemonic, rd, imm);
2242 uint8_t high_reg,
op, rm, rd, h1, h2;
2243 char *mnemonic =
NULL;
2246 high_reg = (opcode & 0x0400) >> 10;
2247 op = (opcode & 0x03C0) >> 6;
2249 rd = (opcode & 0x0007);
2250 rm = (opcode & 0x0038) >> 3;
2251 h1 = (opcode & 0x0080) >> 7;
2252 h2 = (opcode & 0x0040) >> 6;
2281 if ((opcode & 0x7) == 0x0) {
2285 snprintf(instruction->
text, 128,
2287 " 0x%4.4x \tBLX\tr%i",
2288 address, opcode, rm);
2291 snprintf(instruction->
text, 128,
2293 " 0x%4.4x \tBX\tr%i",
2294 address, opcode, rm);
2298 snprintf(instruction->
text, 128,
2301 "UNDEFINED INSTRUCTION",
2395 snprintf(instruction->
text, 128,
2396 "0x%8.8" PRIx32
" 0x%4.4x \tNOP\t\t\t"
2398 address, opcode, mnemonic, rd, rm);
2400 snprintf(instruction->
text, 128,
2401 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tr%i, r%i",
2402 address, opcode, mnemonic, rd, rm);
2410 return (
addr + 4) & ~3;
2417 uint8_t rd = (opcode >> 8) & 0x7;
2420 immediate = opcode & 0x000000ff;
2429 snprintf(instruction->
text, 128,
2430 "0x%8.8" PRIx32
" 0x%4.4x \t"
2431 "LDR\tr%i, [pc, #%#" PRIx32
"]\t; %#8.8" PRIx32,
2432 address, opcode, rd, immediate,
2441 uint8_t rd = (opcode >> 0) & 0x7;
2442 uint8_t rn = (opcode >> 3) & 0x7;
2443 uint8_t rm = (opcode >> 6) & 0x7;
2444 uint8_t opc = (opcode >> 9) & 0x7;
2445 char *mnemonic =
NULL;
2482 snprintf(instruction->
text, 128,
2483 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tr%i, [r%i, r%i]",
2484 address, opcode, mnemonic, rd, rn, rm);
2498 uint32_t
offset = (opcode >> 6) & 0x1f;
2499 uint8_t rd = (opcode >> 0) & 0x7;
2500 uint8_t rn = (opcode >> 3) & 0x7;
2501 uint32_t l = opcode & (1 << 11);
2502 uint32_t b = opcode & (1 << 12);
2515 if ((opcode&0xF000) == 0x8000) {
2523 snprintf(instruction->
text, 128,
2524 "0x%8.8" PRIx32
" 0x%4.4x \t%s%c\tr%i, [r%i, #%#" PRIx32
"]",
2525 address, opcode, mnemonic, suffix, rd, rn,
offset << shift);
2539 uint32_t
offset = opcode & 0xff;
2540 uint8_t rd = (opcode >> 8) & 0x7;
2541 uint32_t l = opcode & (1 << 11);
2552 snprintf(instruction->
text, 128,
2553 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tr%i, [SP, #%#" PRIx32
"]",
2554 address, opcode, mnemonic, rd,
offset*4);
2568 uint32_t imm = opcode & 0xff;
2569 uint8_t rd = (opcode >> 8) & 0x7;
2571 uint32_t sp = opcode & (1 << 11);
2572 const char *reg_name;
2584 snprintf(instruction->
text, 128,
2585 "0x%8.8" PRIx32
" 0x%4.4x \tADD\tr%i, %s, #%#" PRIx32,
2586 address, opcode, rd, reg_name, imm * 4);
2599 uint32_t imm = opcode & 0x7f;
2600 uint8_t opc = opcode & (1 << 7);
2612 snprintf(instruction->
text, 128,
2613 "0x%8.8" PRIx32
" 0x%4.4x \t%s\tSP, #%#" PRIx32,
2614 address, opcode, mnemonic, imm*4);
2627 uint32_t imm = opcode & 0xff;
2631 snprintf(instruction->
text, 128,
2632 "0x%8.8" PRIx32
" 0x%4.4x \tBKPT\t%#2.2" PRIx32
"",
2633 address, opcode, imm);
2641 uint32_t reg_list = opcode & 0xff;
2642 uint32_t l = opcode & (1 << 11);
2643 uint32_t r = opcode & (1 << 8);
2644 uint8_t rn = (opcode >> 8) & 7;
2645 uint8_t addr_mode = 0 ;
2649 char ptr_name[7] =
"";
2656 if ((opcode & 0xf000) == 0xc000) {
2662 if (opcode & (1 << rn))
2668 snprintf(ptr_name,
sizeof(ptr_name),
"r%i%s, ", rn, wback);
2675 reg_list |= (1 << 15) ;
2681 reg_list |= (1 << 14) ;
2685 reg_names_p = reg_names;
2686 for (i = 0; i <= 15; i++) {
2687 if (reg_list & (1 << i))
2688 reg_names_p += snprintf(reg_names_p,
2689 (reg_names + 40 - reg_names_p),
2693 if (reg_names_p > reg_names)
2694 reg_names_p[-2] =
'\0';
2696 reg_names[0] =
'\0';
2698 snprintf(instruction->
text, 128,
2699 "0x%8.8" PRIx32
" 0x%4.4x \t%s\t%s{%s}",
2700 address, opcode, mnemonic, ptr_name, reg_names);
2712 uint32_t
offset = opcode & 0xff;
2713 uint8_t cond = (opcode >> 8) & 0xf;
2714 uint32_t target_address;
2718 snprintf(instruction->
text, 128,
2719 "0x%8.8" PRIx32
" 0x%4.4x \tSVC\t%#2.2" PRIx32,
2720 address, opcode,
offset);
2722 }
else if (cond == 0xe) {
2724 snprintf(instruction->
text, 128,
2725 "0x%8.8" PRIx32
" 0x%4.4x \tUNDEFINED INSTRUCTION",
2734 target_address = address + 4 + (
offset << 1);
2736 snprintf(instruction->
text, 128,
2737 "0x%8.8" PRIx32
" 0x%4.4x \tB%s\t%#8.8" PRIx32,
2754 offset = (opcode >> 3) & 0x1f;
2755 offset |= (opcode & 0x0200) >> 4;
2757 snprintf(instruction->
text, 128,
2758 "0x%8.8" PRIx32
" 0x%4.4x \tCB%sZ\tr%d, %#8.8" PRIx32,
2760 (opcode & 0x0800) ?
"N" :
"",
2761 opcode & 0x7, address + 4 + (
offset << 1));
2770 snprintf(instruction->
text, 128,
2771 "0x%8.8" PRIx32
" 0x%4.4x \t%cXT%c\tr%d, r%d",
2773 (opcode & 0x0080) ?
'U' :
'S',
2774 (opcode & 0x0040) ?
'B' :
'H',
2775 opcode & 0x7, (opcode >> 3) & 0x7);
2784 if ((opcode & 0x0ff0) == 0x0650)
2785 snprintf(instruction->
text, 128,
2786 "0x%8.8" PRIx32
" 0x%4.4x \tSETEND %s",
2788 (opcode & 0x80) ?
"BE" :
"LE");
2790 snprintf(instruction->
text, 128,
2791 "0x%8.8" PRIx32
" 0x%4.4x \tCPSI%c\t%s%s%s",
2793 (opcode & 0x0010) ?
'D' :
'E',
2794 (opcode & 0x0004) ?
"A" :
"",
2795 (opcode & 0x0002) ?
"I" :
"",
2796 (opcode & 0x0001) ?
"F" :
"");
2807 switch ((opcode >> 6) & 3) {
2818 snprintf(instruction->
text, 128,
2819 "0x%8.8" PRIx32
" 0x%4.4x \tREV%s\tr%d, r%d",
2820 address, opcode, suffix,
2821 opcode & 0x7, (opcode >> 3) & 0x7);
2831 switch ((opcode >> 4) & 0x0f) {
2848 hint =
"HINT (UNRECOGNIZED)";
2852 snprintf(instruction->
text, 128,
2853 "0x%8.8" PRIx32
" 0x%4.4x \t%s",
2854 address, opcode, hint);
2862 unsigned cond = (opcode >> 4) & 0x0f;
2863 char *x =
"", *y =
"", *z =
"";
2866 z = (opcode & 0x02) ?
"T" :
"E";
2868 y = (opcode & 0x04) ?
"T" :
"E";
2870 x = (opcode & 0x08) ?
"T" :
"E";
2872 snprintf(instruction->
text, 128,
2873 "0x%8.8" PRIx32
" 0x%4.4x \tIT%s%s%s\t%s",
2888 instruction->
opcode = opcode;
2891 if ((opcode & 0xe000) == 0x0000) {
2893 if ((opcode & 0x1800) == 0x1800)
2901 if ((opcode & 0xe000) == 0x2000)
2905 if ((opcode & 0xf800) == 0x4000)
2909 if ((opcode & 0xf800) == 0x4800)
2913 if ((opcode & 0xf000) == 0x5000)
2917 if (((opcode & 0xe000) == 0x6000)
2918 || ((opcode & 0xf000) == 0x8000))
2922 if ((opcode & 0xf000) == 0x9000)
2926 if ((opcode & 0xf000) == 0xa000)
2930 if ((opcode & 0xf000) == 0xb000) {
2931 switch ((opcode >> 8) & 0x0f) {
2950 if ((opcode & 0x00c0) == 0x0080)
2956 if (opcode & 0x000f)
2965 snprintf(instruction->
text, 128,
2966 "0x%8.8" PRIx32
" 0x%4.4x \tUNDEFINED INSTRUCTION",
2972 if ((opcode & 0xf000) == 0xc000)
2976 if ((opcode & 0xf000) == 0xd000)
2979 if ((opcode & 0xe000) == 0xe000) {
2981 if ((opcode & 0xf801) == 0xe801) {
2983 snprintf(instruction->
text, 128,
2984 "0x%8.8" PRIx32
" 0x%8.8x\t"
2985 "UNDEFINED INSTRUCTION",
2992 LOG_ERROR(
"Thumb: should never reach this point (opcode=%04x)", opcode);
3017 LOG_ERROR(
"BUG: instruction type %i isn't a load/store instruction",
3026 uint32_t opcode = 0;
3028 memcpy(&opcode, insn->bytes, insn->size);
3030 if (insn->size == 4) {
3031 uint16_t opcode_high = opcode >> 16;
3032 opcode = opcode & 0xffff;
3035 insn->address, opcode, opcode_high, insn->mnemonic,
3036 insn->op_str[0] ?
"\t" :
"", insn->op_str);
3039 insn->address, opcode, insn->mnemonic,
3040 insn->op_str[0] ?
"\t" :
"", insn->op_str);
3052 if (!cs_support(CS_ARCH_ARM)) {
3053 LOG_ERROR(
"ARM architecture not supported by capstone");
3057 mode = CS_MODE_LITTLE_ENDIAN;
3060 mode |= CS_MODE_THUMB;
3062 ret = cs_open(CS_ARCH_ARM,
mode, &handle);
3064 if (ret != CS_ERR_OK) {
3065 LOG_ERROR(
"cs_open() failed: %s", cs_strerror(ret));
3069 ret = cs_option(handle, CS_OPT_SKIPDATA, CS_OPT_ON);
3071 if (ret != CS_ERR_OK) {
3072 LOG_ERROR(
"cs_option() failed: %s", cs_strerror(ret));
3077 insn = cs_malloc(handle);
3097 const uint8_t *tmp =
buffer;
3099 ret = cs_disasm_iter(handle, &tmp, &
size, &address, insn);
3102 LOG_ERROR(
"cs_disasm_iter() failed: %s",
3103 cs_strerror(cs_errno(handle)));
3109 print_opcode(
cmd, insn);
static int evaluate_load_store_reg_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_load_store(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_b_bl(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_media(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_cb_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_load_store_imm_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_cdp_mcr_mrc(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static uint32_t ror(uint32_t value, int places)
static int evaluate_cond_branch_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_mov_imm(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
int arm_evaluate_opcode(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_srs(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_p_add_sub(uint32_t opcode, uint32_t address, char *cp)
static int evaluate_pld(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
int thumb_evaluate_opcode(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_load_literal_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_breakpoint_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_extend_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_data_proc(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_misc_load_store(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_load_store_multiple_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static uint32_t thumb_alignpc4(uint32_t addr)
static int evaluate_ldm_stm(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_ldc_stc_mcrr_mrrc(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static const char * arm_condition_strings[]
static int evaluate_shift_imm_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
int arm_access_size(struct arm_instruction *instruction)
static int evaluate_swi(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_cps_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_blx_imm(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_load_store_stack_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_mul_and_extra_ld_st(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_ifthen_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_data_proc_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_misc_instr(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_data_proc_imm_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_mrs_msr(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_byterev_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_b_bl_blx_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_add_sub_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_unknown(uint32_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_adjust_stack_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_add_sp_pc_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_hint_thumb(uint16_t opcode, uint32_t address, struct arm_instruction *instruction)
static int evaluate_extend(uint32_t opcode, uint32_t address, char *cp)
@ ARM_UNKNOWN_INSTRUCTION
@ ARM_UNDEFINED_INSTRUCTION
void command_print(struct command_invocation *cmd, const char *format,...)
#define LOG_ERROR(expr ...)
size_t size
Size of the control block search area.
union arm_shifter_operand shifter_operand
struct arm_load_store_multiple_instr load_store_multiple
enum arm_instruction_type type
union arm_instruction::@65 info
unsigned instruction_size
struct arm_b_bl_bx_blx_instr b_bl_bx_blx
struct arm_load_store_instr load_store
struct arm_data_proc_instr data_proc
When run_command is called, a new instance will be created on the stack, filled with the proper value...
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
struct arm_shifter_operand::@62 register_shift
struct arm_shifter_operand::@61 immediate_shift