54 return (
a &&
b) ? strcmp(
a,
b) : -1;
81 {
"nop", 0xa0e1, -1 },
235 const char *
conds[] = {
236 "eq",
"ne",
"cs",
"cc",
"mi",
"pl",
"vs",
"vc",
237 "hi",
"ls",
"ge",
"lt",
"gt",
"le",
"al",
"nv", 0
258 if (**
input ==
'\0') {
269 if (strlen(opcode) > strlen(
input)) {
273 input += strlen(opcode);
277 if ((*
input ==
's') && (
S_BIT & allowed_mask)) {
309 if ((*
input ==
'l') && (
L_BIT & allowed_mask)) {
331 if ((*
input ==
'w') && (
W_BIT & allowed_mask)) {
335 if ((*
input ==
'b') && (
B_BIT & allowed_mask)) {
338 }
else if ((*
input ==
'h') && (
H_BIT & allowed_mask)) {
341 }
else if ((*
input ==
'd') && (
D_BIT & allowed_mask)) {
345 if ((*
input ==
't') && (
T_BIT & allowed_mask)) {
349 if ((*
input ==
's') && (
S_BIT & allowed_mask)) {
372 if ((*
input ==
'l') && (
L_BIT & allowed_mask)) {
376 if ((*
input ==
'x') && (
X_BIT & allowed_mask)) {
409 if (2 > strlen(
input)) {
415 if (strlen(
input) > 3) {
418 res |= (strlen(
input) & 0x3) << 4;
446 while (*
str ==
'$' || *
str ==
'#') {
449 val = strtoll(
str, &endptr, 0);
450 if (
str != endptr && *endptr ==
'\0') {
486 if (
num == (
num & 0xff)) {
498 ut32 forwardmask = 0x80000000;
499 ut32 backwardmask = 0x1;
501 for (
i = 0;
i < 32;
i++) {
502 if ((forwardmask &
num) && (
f == -1)) {
505 if ((backwardmask &
num) && (
b == -1)) {
524 res |= ((number & 0xff) << 8);
526 res |= (number & 0x07);
528 res |= ((number & 0xff) << 24);
530 res |= ((number & 0x3) << 16);
533 res |= ((number & 0x1) << 3);
535 res |= ((number & 0x1) << 5);
537 res |= ((!(number & 0x1)) << 3);
539 res |= ((!(number & 0x1)) << 5);
546 res |= (number & 0x800) << 7;
547 res |= (number & 0x700) >> 4;
548 res |= (number & 0x0ff) << 8;
554 res |= (number & 0xf000) << 12;
555 res |= (number & 0x0800) << 7;
556 res |= (number & 0x0700) >> 4;
557 res |= (number & 0x00ff) << 8;
571 }
else if (((
num & 0xff00ff00) == 0) && ((
num & 0x00ff0000) == ((
num & 0x000000ff) << 16))) {
572 result |= (
num & 0x000000ff) << 8;
573 result |= 0x00000010;
575 }
else if (((
num & 0x00ff00ff) == 0) && ((
num & 0xff000000) == ((
num & 0x0000ff00) << 16))) {
576 result |=
num & 0x0000ff00;
577 result |= 0x00000020;
579 }
else if (((
num & 0xff000000) == ((
num & 0x00ff0000) << 8)) && ((
num & 0xff000000) == ((
num & 0x0000ff00) << 16)) && ((
num & 0xff000000) == ((
num & 0x000000ff) << 24))) {
580 result |=
num & 0x0000ff00;
581 result |= 0x00000030;
586 result |= ((
num >> (24 - FSD)) & 0x0000007f) << 8;
587 result |= ((8 + FSD) & 0x1) << 15;
588 result |= ((8 + FSD) & 0xe) << 3;
589 result |= ((8 + FSD) & 0x10) << 14;
605 if (*
s ==
'[' || *
s ==
']') {
606 memmove(
s,
s + 1, strlen(
s + 1) + 1);
613 while (
p && *
p ==
' ') {
623 const char *aliases[] = {
"sb",
"sl",
"fp",
"ip",
"sp",
"lr",
"pc",
NULL };
628 int reg = strtol(
str + 1, &ep, 10);
629 if ((ep[0] !=
'\0') || (
str[1] ==
'\0')) {
632 if (reg < 16 && reg >= 0) {
636 for (
i = 0; aliases[
i];
i++) {
645 st32 tempres, res = 0;
660 while (*
input !=
'\0') {
670 if (*
input !=
'\0') {
674 for (
i = 0; temp[
i] !=
'-' && temp[
i] !=
'\0';
i++) {
677 if (
i == strlen(temp)) {
679 if (tempres == -1 || tempres > 15) {
685 strncpy(temp2, temp,
i);
694 if (
end == -1 ||
end > 15) {
711 if ((strlen(
input) < 1) || (!(*
input ==
'['))) {
820 int coproc = strtol(
str + 1, &ep, 10);
821 if ((ep[0] !=
'\0') || (
str[1] ==
'\0')) {
824 if (coproc < 16 && coproc >= 0) {
838 int reg = strtol(
str + 1, &ep, 10);
839 if ((ep[0] !=
'\0') || (
str[1] ==
'\0')) {
842 if (reg < 16 && reg >= 0) {
850 const char fields[] = {
'c',
'x',
's',
'f', 0 };
860 if (!(strcmp(
str + 5,
"g"))) {
863 if (!(strcmp(
str + 5,
"nzcvq"))) {
866 if (!(strcmp(
str + 5,
"nzcvqg"))) {
871 for (
i = 0;
str[5 +
i];
i++) {
872 for (j = 0;
fields[j]; j++) {
889 const char *shifts[] = {
890 "LSL",
"LSR",
"ASR",
"ROR", 0,
"RRX"
903 if (!strcmp(
type, shifts[5])) {
910 space = strchr(
type,
' ');
919 for (
i = 0; shifts[
i];
i++) {
920 if (!strcmp(
type, shifts[
i])) {
934 if (
err || argn > 32) {
940 res |= ((argn & 0x1c) << 2);
941 res |= ((argn & 0x3) << 14);
966 for (
i = 0;
i < 15;
i++) {
1005 res |= 8 << (
i * 4);
1011 res |= 9 << (
i * 4);
1015 res |= 0xa << (
i * 4);
1019 res |= 0xb << (
i * 4);
1023 res |= 0xc << (
i * 4);
1027 res |= 0xd << (
i * 4);
1033 res |= 0xe << (
i * 4);
1036 res |= 0xf << (
i * 4);
1047 const char *shifts[] = {
1048 "LSL",
"LSR",
"ASR",
"ROR",
1055 space = strchr(
type,
' ');
1060 strncpy(
arg, ++space,
sizeof(
arg) - 1);
1062 for (
i = 0; shifts[
i];
i++) {
1081 char *bracket = strchr(
arg,
']');
1101 if (strlen(
str) + 1 >=
sizeof(ao->
op)) {
1104 strncpy(ao->
op,
str,
sizeof(ao->
op) - 1);
1106 char *
c = strchr(ao->
op,
' ');
1110 for (
size_t i = 0;
i < 16;
i++) {
1120 while (*
c && *
c !=
',') {
1141 const char *
conds[] = {
1142 "eq",
"ne",
"cs",
"cc",
"mi",
"pl",
"vs",
"vc",
1143 "hi",
"ls",
"ge",
"lt",
"gt",
"le",
"al",
"nv", 0
1227 if ((
rd > 15) || (rn > 15) || (rm > 15) || (
m &
DOTN_BIT)) {
1248 ao->
a[2] = ao->
a[1];
1249 ao->
a[1] = ao->
a[0];
1253 ao->
a[3] = ao->
a[2];
1254 ao->
a[2] = ao->
a[1];
1255 ao->
a[1] = ao->
a[0];
1278 if ((reg1 > 15) || (reg2 > 15)) {
1286 ao->
o |= (
num >> 2) << 8;
1292 ao->
o |= (
num >> 2) << 8;
1320 ao->
o |= (
num & 0x3) << 14;
1321 ao->
o |= (
num >> 2);
1327 if ((reg1 < 8) && (reg1 == reg2) && (
num < 256)) {
1359 if (ao->
a[3] ==
NULL) {
1370 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15)) {
1377 ao->
o |= (reg1 & 0x7) << 8;
1378 ao->
o |= (reg1 >> 3) << 15;
1384 ao->
o |= reg3 << 11;
1400 ao->
o |= (reg3 >> 2);
1401 ao->
o |= (reg3 & 0x3) << 14;
1409 ao->
o |= (reg1 & 0x7) << 8;
1410 ao->
o |= (reg1 >> 3) << 15;
1411 ao->
o |= reg3 << 11;
1457 }
else if ((
m =
opmask(ao->
op,
"adr", 0))) {
1466 ao->
o |= (
label / 4) << 8;
1535 if (((
int)
imm < 1) && ((
int)
imm > 32)) {
1539 ao->
o |= (
imm & 0x3) << 14;
1540 ao->
o |= (
imm & 0x1c) >> 2;
1547 ao->
o |= (
imm & 0x3) << 14;
1548 ao->
o |= (
imm & 0x1c) << 2;
1569 }
else if ((
m =
opmask(ao->
op,
"b", 0))) {
1581 ao->
o |= ((
offset / 2 & 0xff) << 8);
1582 ao->
o |= ((
offset / 2 & 0x700) >> 8);
1611 ao->
o |= (((
m &
C_BITS) & 0xc) << 28);
1612 ao->
o |= (((
m &
C_BITS) & 0x30) << 12);
1619 }
else if (
opmask(ao->
op,
"bl", 0)) {
1634 }
else if (
opmask(ao->
op,
"bx", 0)) {
1640 ao->
o |= reg1 << 11;
1646 }
else if (
opmask(ao->
op,
"blx", 0)) {
1652 ao->
o |= reg1 << 11;
1668 }
else if ((
m =
opmask(ao->
op,
"bfc", 0))) {
1680 if ((lsb > 31) || (msb > 31)) {
1685 ao->
o |= ((lsb & 0x1c) << 2);
1686 ao->
o |= ((lsb & 0x3) << 14);
1687 ao->
o |= (msb << 8);
1693 }
else if ((
m =
opmask(ao->
op,
"bfi", 0))) {
1700 if ((lsb > 31) || (msb > 31)) {
1704 ao->
o |= ((lsb & 0x1c) << 2);
1705 ao->
o |= ((lsb & 0x3) << 14);
1706 ao->
o |= (msb << 8);
1747 }
else if (
opmask(ao->
op,
"bkpt", 0)) {
1762 }
else if (
opmask(ao->
op,
"cbnz", 0)) {
1768 if ((reg1 > 7) || (
offset > 127) || (
offset % 2 != 0)) {
1773 ao->
o |= (
offset & 0x3e) << 10;
1774 ao->
o |= (
offset & 0x40) >> 5;
1780 }
else if (
opmask(ao->
op,
"cbz", 0)) {
1786 if ((reg1 > 7) || (
offset > 127) || (
offset % 2 != 0)) {
1791 ao->
o |= (
offset & 0x3e) << 10;
1792 ao->
o |= (
offset & 0x40) >> 5;
1812 if ((coproc > 15) || (opc1 > 15) || (opc2 > 7)) {
1820 ao->
o |= opc1 << 28;
1822 ao->
o |= reg2 << 24;
1824 ao->
o |= opc2 << 13;
1830 }
else if (
opmask(ao->
op,
"clrex", 0)) {
1840 }
else if ((
m =
opmask(ao->
op,
"clz", 0))) {
1845 ao->
a[2] = ao->
a[1];
1851 }
else if ((
m =
opmask(ao->
op,
"cmn", 0))) {
1858 ao->
o |= reg1 << 24;
1877 }
else if ((
m =
opmask(ao->
op,
"cmp", 0))) {
1891 ao->
o |= reg1 << 24;
1904 ao->
o |= ((reg1 & 0x7) << 8);
1905 ao->
o |= ((reg1 & 0x8) << 12);
1906 ao->
o |= reg2 << 11;
1917 ao->
o |= reg1 << 24;
1947 if ((
mode > 31) || (aif == -1)) {
1970 }
else if (
opmask(ao->
op,
"dbg", 0)) {
1985 }
else if (
opmask(ao->
op,
"dmb", 0)) {
2012 }
else if (
opmask(ao->
op,
"dsb", 0)) {
2073 }
else if (
opmask(ao->
op,
"isb", 0)) {
2108 const char *
conds[] = {
2109 "eq",
"ne",
"cs",
"cc",
"mi",
"pl",
"vs",
"vc",
2110 "hi",
"ls",
"ge",
"lt",
"gt",
"le",
"al",
"nv", 0
2124 ao->
o |=
cond << 12;
2126 ut8 nrcs = (
m & 0x30) >> 4;
2129 for (
i = 0;
i < nrcs;
i++) {
2130 thiset = ((
m & (1 << (3 -
i))) >> (3 -
i));
2131 ao->
o |= ((
cond & 0x1) ^ thiset) << (11 -
i);
2133 ao->
o |= 1 << (11 -
i);
2159 if ((
proc > 15) || (reg1 > 15) || (reg2 > 15) || (
imm > 1024) || (
imm % 4 != 0)) {
2164 ao->
o |= (
imm >> 2) << 8;
2165 ao->
o |= reg2 << 24;
2188 if ((
proc > 15) || (reg1 > 15) || (reg2 > 15) || (
imm > 1024) || (
imm % 4 != 0)) {
2193 ao->
o |= (
imm >> 2) << 8;
2194 ao->
o |= reg2 << 24;
2214 if ((
proc > 15) || (reg1 > 15) || (reg2 > 15) || (
imm > 1024) || (
imm % 4 != 0)) {
2219 ao->
o |= (
imm >> 2) << 8;
2220 ao->
o |= reg2 << 24;
2235 if (
list & (1 << reg1)) {
2236 list ^= 1 << (reg1);
2238 ao->
o |= (
list & 0xff) << 8;
2242 if (
list & 0x2000) {
2252 ao->
o |= reg1 << 24;
2253 ao->
o |= (
list & 0xff) << 8;
2254 ao->
o |= (
list & 0xff00) >> 8;
2263 ao->
o |= 1 << (reg1 + 8);
2264 ao->
o |= (
list & 0xff) << 8;
2267 if (
list & 0x2000) {
2277 ao->
o |= reg1 << 24;
2278 ao->
o |= (
list & 0xff) << 8;
2279 ao->
o |= (
list & 0xff00) >> 8;
2293 ao->
a[2] = ao->
a[1];
2294 strcat(ao->
a[2],
"]");
2298 if (ao->
a[2] ==
NULL) {
2299 ao->
a[1][strlen(ao->
a[1]) - 1] =
'\0';
2309 if ((
num < 0) || (
num > 255)) {
2317 if ((
num > 4095) || (
num < -4095)) {
2320 if ((reg1 < 8) && (
num < 1024) && (
num % 4 == 0)) {
2323 ao->
o |= (
num >> 2) << 8;
2333 ao->
o |= (
num & 0xff) << 8;
2334 ao->
o |= (
num & 0x0f00) >> 8;
2337 if ((reg2 == 13) && (reg1 < 8) && (
num >= 0) && (
num < 1024) && (
num % 4 == 0) && (!(
m &
DOTW_BIT))) {
2340 ao->
o |= (
num >> 2) << 8;
2343 if ((
num >= 0) && (
num < 128) && (
num % 4 == 0)) {
2345 ao->
o |= (
num >> 4);
2346 ao->
o |= ((
num >> 2) & 0x3) << 14;
2351 if ((
num > 4095) || (
num < -1023)) {
2356 ao->
o |= (
num & 0xff) << 8;
2357 ao->
o |= (
num & 0xf00) >> 8;
2361 ao->
o |= (-
num & 0xff) << 8;
2363 }
else if (ldrsel ==
B_BIT) {
2365 if ((
num < 0) || (
num > 255)) {
2376 if ((
num > 4095) || (
num < -4095)) {
2389 ao->
o |= (
num & 0xff) << 8;
2390 ao->
o |= (
num & 0x0f00) >> 8;
2395 ao->
o |= (
num >> 2);
2396 ao->
o |= (
num & 0x3) << 14;
2401 if ((
num > 4095) || (
num < -255)) {
2409 ao->
o |= (
num & 0xff) << 8;
2410 ao->
o |= (
num & 0xf00) >> 8;
2419 }
else if (ldrsel ==
H_BIT) {
2421 if ((
num < 0) || (
num > 255)) {
2432 if ((
num > 4095) || (
num < -4095)) {
2445 ao->
o |= (
num & 0xff) << 8;
2446 ao->
o |= (
num & 0x0f00) >> 8;
2451 ao->
o |= (
num >> 3);
2452 ao->
o |= ((
num >> 1) & 0x3) << 14;
2457 if ((
num > 4095) || (
num < -255)) {
2465 ao->
o |= (
num & 0xff) << 8;
2466 ao->
o |= (
num & 0xf00) >> 8;
2483 if ((
num < -255) || (
num > 255)) {
2488 }
else if (ldrsel ==
B_BIT) {
2490 }
else if (ldrsel ==
H_BIT) {
2505 ao->
o |= reg2 << 24;
2510 if ((
num < -255) || (
num > 255)) {
2515 }
else if (ldrsel ==
B_BIT) {
2517 }
else if (ldrsel ==
H_BIT) {
2538 }
else if (ldrsel ==
B_BIT) {
2544 }
else if (ldrsel ==
H_BIT) {
2553 ao->
o |= (reg3 & 0x3) << 14;
2554 ao->
o |= (reg3 & 0x4) >> 2;
2559 ao->
a[2][strlen(ao->
a[2]) - 1] =
'\0';
2560 ao->
a[3] =
"lsl 0]";
2568 if (
shift & 0xffffcfff) {
2574 }
else if (ldrsel ==
B_BIT) {
2576 }
else if (ldrsel ==
H_BIT) {
2589 ao->
a[2][strlen(ao->
a[2]) - 1] =
'\0';
2599 if ((
num > 1020) || (
num < -1020) || (
num % 4 != 0) || (ldrsel !=
D_BIT)) {
2610 ao->
o |= reg3 << 24;
2611 ao->
o |= (
num >> 2) << 8;
2619 if ((
num > 1020) || (
num < -1020) || (
num % 4 != 0) || (ldrsel !=
D_BIT)) {
2630 ao->
o |= reg3 << 24;
2631 ao->
o |= (
num >> 2) << 8;
2639 if ((
num > 1020) || (
num < -1020) || (
num % 4 != 0) || (ldrsel !=
D_BIT)) {
2650 ao->
o |= reg3 << 24;
2651 ao->
o |= (
num >> 2) << 8;
2665 if (ldrsel ==
B_BIT) {
2668 ao->
o |= reg2 << 24;
2670 }
else if (ldrsel ==
H_BIT) {
2673 ao->
o |= reg2 << 24;
2675 }
else if (ldrsel == 0) {
2676 ao->
a[1][strlen(ao->
a[1]) - 1] =
'\0';
2685 if ((ldrsel != 0) || (
num < 0) || (
num > 1020) || (
num % 4 != 0)) {
2689 ao->
o |= (
num >> 2) << 8;
2696 if (!(ldrsel &
D_BIT)) {
2702 ao->
o |= reg3 << 24;
2720 ao->
o |= (
num & 0x03) << 14;
2727 ao->
o |= (
num >> 2) << 4;
2728 ao->
o |= (
num & 0x3) << 14;
2761 ao->
o |= (
num & 0x03) << 14;
2768 ao->
o |= (
num >> 2) << 4;
2769 ao->
o |= (
num & 0x3) << 14;
2805 if ((coproc > 15) || (opc1 > 7) || (reg1 > 15) || (coreg1 > 15) || (coreg2 > 15) || (opc2 > 7) || (
m &
RZ_BIT)) {
2814 ao->
o |= opc1 << 29;
2816 ao->
o |= coreg1 << 24;
2817 ao->
o |= coreg2 << 8;
2818 ao->
o |= opc2 << 13;
2828 if ((coproc > 15) || (
opc > 15) || (reg1 > 15) || (reg2 > 15) || (coreg > 15) || (!(
m &
RZ_BIT))) {
2839 ao->
o |= reg2 << 24;
2840 ao->
o |= coreg << 8;
2846 }
else if ((
m =
opmask(ao->
op,
"mla", 0))) {
2862 }
else if ((
m =
opmask(ao->
op,
"mls", 0))) {
2927 if ((reg1 > 15) || (reg2 > 15)) {
2933 ao->
o |= (reg1 & 0x7) << 8;
2934 ao->
o |= (reg1 & 0x8) << 12;
2935 ao->
o |= reg2 << 11;
2939 if ((reg1 < 8) && (reg2 < 8) && (!(
m &
DOTW_BIT))) {
2942 ao->
o |= reg2 << 11;
2972 if ((coproc > 15) || (opc1 > 7) || (reg1 > 15) || (coreg1 > 15) || (coreg2 > 15) || (opc2 > 7)) {
2981 ao->
o |= opc1 << 29;
2983 ao->
o |= coreg1 << 24;
2984 ao->
o |= coreg2 << 8;
2985 ao->
o |= opc2 << 13;
3001 if ((coproc > 15) || (
opc > 15) || (reg1 > 15) || (reg2 > 15) || (coreg > 15)) {
3012 ao->
o |= reg2 << 24;
3013 ao->
o |= coreg << 8;
3019 }
else if (
opmask(ao->
op,
"mrs", 0)) {
3030 if ((!strcmp(ao->
a[1],
"cpsr")) || (!strcmp(ao->
a[1],
"apsr"))) {
3036 if (!strcmp(ao->
a[1],
"spsr")) {
3047 }
else if (
opmask(ao->
op,
"msr", 0)) {
3056 if ((bank == 0) || (reg1 > 15)) {
3061 ao->
o |= reg1 << 24;
3071 }
else if ((
m =
opmask(ao->
op,
"mul", 0))) {
3101 if ((reg1 > 15) ||
err) {
3122 if ((reg1 > 15) || (reg2 > 15)) {
3143 }
else if ((
m =
opmask(ao->
op,
"nop", 0))) {
3185 if (ao->
a[3] ==
NULL) {
3229 if (ao->
a[3] ==
NULL) {
3259 if (ao->
a[3] ==
NULL) {
3277 }
else if (
opmask(ao->
op,
"pld", 0)) {
3285 if ((
num < -4095) || (
num > 4095)) {
3294 ao->
o |= (
num & 0x0ff) << 8;
3295 ao->
o |= (
num & 0xf00) >> 8;
3299 if ((reg1 > 15) || (
num < -255) || (
num > 4095)) {
3305 ao->
o |= (
num & 0x0ff) << 8;
3306 ao->
o |= (
num & 0xf00) >> 8;
3307 ao->
o |= reg1 << 24;
3313 ao->
o |= reg1 << 24;
3317 ao->
a[1][strlen(ao->
a[1]) - 1] =
'\0';
3318 ao->
a[2] =
"lsl 0]";
3326 if ((reg1 > 15) || (reg2 > 15) || ((
shift & 0xffffcfff) != 0)) {
3331 ao->
o |= reg1 << 24;
3339 }
else if (
opmask(ao->
op,
"pli", 0)) {
3347 if ((
num < -4095) || (
num > 4095)) {
3356 ao->
o |= (
num & 0x0ff) << 8;
3357 ao->
o |= (
num & 0xf00) >> 8;
3361 if ((reg1 > 15) || (
num < -255) || (
num > 4095)) {
3367 ao->
o |= (
num & 0x0ff) << 8;
3368 ao->
o |= (
num & 0xf00) >> 8;
3369 ao->
o |= reg1 << 24;
3375 ao->
o |= reg1 << 24;
3379 ao->
a[1][strlen(ao->
a[1]) - 1] =
'\0';
3380 ao->
a[2] =
"lsl 0]";
3388 if ((reg1 > 15) || (reg2 > 15) || ((
shift & 0xffffcfff) != 0)) {
3393 ao->
o |= reg1 << 24;
3401 }
else if ((
m =
opmask(ao->
op,
"pop", 0))) {
3406 if ((
list <= 0) || ((
list & (1 << 13)) != 0)) {
3411 ao->
o |= (
list & 0x8000) >> 15;
3412 ao->
o |= (
list & 0xff) << 8;
3416 ao->
o |= (
list & 0xff00) >> 8;
3417 ao->
o |= (
list & 0xff) << 8;
3423 }
else if ((
m =
opmask(ao->
op,
"push", 0))) {
3428 if ((
list <= 0) || ((
list & 0x0000a000) != 0)) {
3433 ao->
o |= (
list & 0x4000) >> 14;
3434 ao->
o |= (
list & 0xff) << 8;
3438 ao->
o |= (
list & 0xff00) >> 8;
3439 ao->
o |= (
list & 0xff) << 8;
3466 }
else if ((
m =
opmask(ao->
op,
"qasx", 0))) {
3480 }
else if ((
m =
opmask(ao->
op,
"qdadd", 0))) {
3494 }
else if ((
m =
opmask(ao->
op,
"qdsub", 0))) {
3508 }
else if ((
m =
opmask(ao->
op,
"qsax", 0))) {
3542 }
else if ((
m =
opmask(ao->
op,
"rbit", 0))) {
3546 ao->
a[2] = ao->
a[1];
3576 ao->
a[2] = ao->
a[1];
3587 ao->
a[0][strlen(ao->
a[0]) - 1] =
'\0';
3604 ao->
o |= reg1 << 24;
3619 if ((reg1 > 15) || (reg2 > 15) || (
num > 31) || (
num < 1)) {
3626 ao->
o |= (
num & 0x3) << 14;
3627 ao->
o |= (
num & 0x1c) << 2;
3655 if ((reg1 > 15) || (reg2 > 15)) {
3703 if (ao->
a[3] ==
NULL) {
3735 }
else if ((
m =
opmask(ao->
op,
"sasx", 0))) {
3765 if (ao->
a[3] ==
NULL) {
3793 }
else if ((
m =
opmask(ao->
op,
"sbfx", 0))) {
3800 if ((lsb > 31) || (msb > 31)) {
3804 ao->
o |= ((lsb & 0x1c) << 2);
3805 ao->
o |= ((lsb & 0x3) << 14);
3806 ao->
o |= ((
width - 1) << 8);
3812 }
else if ((
m =
opmask(ao->
op,
"sdiv", 0))) {
3826 }
else if ((
m =
opmask(ao->
op,
"sel", 0))) {
3840 }
else if (
opmask(ao->
op,
"setend", 0)) {
3859 }
else if ((
m =
opmask(ao->
op,
"sev", 0))) {
3894 }
else if ((
m =
opmask(ao->
op,
"shasx", 0))) {
3908 }
else if ((
m =
opmask(ao->
op,
"shsax", 0))) {
3942 }
else if (
opmask(ao->
op,
"smc", 0)) {
3969 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15) || (
m &
DOTN_BIT)) {
3991 ao->
o |= reg3 << 24;
4066 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15) || (
m &
DOTN_BIT)) {
4077 ao->
o |= reg3 << 24;
4187 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15) || (
m &
DOTN_BIT) || (!(
m &
L_BIT))) {
4194 ao->
o |= reg3 << 24;
4223 ao->
a[0][strlen(ao->
a[0]) - 1] =
'\0';
4261 if (
shift & 0x00002000) {
4262 shift |= 0x20000000;
4263 shift &= 0xffffdfff;
4273 ao->
o |= reg2 << 24;
4281 }
else if ((
m =
opmask(ao->
op,
"ssax", 0))) {
4319 ao->
a[2][strlen(ao->
a[2]) - 1] =
'\0';
4329 if ((coproc > 15) || (coreg > 15) || (
reg > 15) || (
num > 4092) || (
num < -4092) || (
num % 4 != 0)) {
4346 ao->
o |= coreg << 4;
4348 ao->
o |= (
num >> 2) << 8;
4357 if ((coproc > 15) || (coreg > 15) || (
reg > 15) || (
num > 4092) || (
num < -4092) || (
num % 4 != 0)) {
4374 ao->
o |= coreg << 4;
4376 ao->
o |= (
num >> 2) << 8;
4385 if ((coproc > 15) || (coreg > 15) || (
reg > 15) || (
num > 4092) || (
num < -4092) || (
num % 4 != 0)) {
4402 ao->
o |= coreg << 4;
4404 ao->
o |= (
num >> 2) << 8;
4416 ao->
a[0][strlen(ao->
a[0]) - 1] =
'\0';
4422 if ((
list <= 0) || ((
list & 0x0000a000) != 0)) {
4428 ao->
o |= (
list & 0x000000ff) << 8;
4448 ao->
o |= (
list & 0x000000ff) << 8;
4449 ao->
o |= (
list & 0x0000ff00) >> 8;
4460 if (ao->
a[2] ==
NULL) {
4461 ao->
a[1][strlen(ao->
a[1]) - 1] =
'\0';
4470 if ((
num < 0) || (
num > 255)) {
4475 }
else if (strsel ==
H_BIT) {
4477 }
else if (strsel ==
B_BIT) {
4486 if ((strsel == 0) && (reg2 == 13) && (
num >= 0) && (
num < 1024) && ((
num % 4) == 0) && (reg1 < 8) & (!(
m &
DOTW_BIT))) {
4489 ao->
o |= (
num >> 2) << 8;
4493 bool t1form =
false;
4494 if ((strsel == 0) && (
num < 128) && (
num >= 0) && (
num % 4 == 0)) {
4496 ao->
o |= (
num >> 4);
4497 ao->
o |= ((
num >> 2) & 0x3) << 14;
4500 if ((strsel ==
B_BIT) && (
num < 32) && (
num >= 0)) {
4502 ao->
o |= (
num >> 2);
4503 ao->
o |= (
num & 0x3) << 14;
4506 if ((strsel ==
H_BIT) && (
num < 64) && (
num >= 0) && (
num % 2 == 0)) {
4508 ao->
o |= (
num >> 3);
4509 ao->
o |= ((
num >> 1) & 0x3) << 14;
4518 if ((
num > 4095) || (
num < -255)) {
4524 }
else if (strsel ==
B_BIT) {
4526 }
else if (strsel ==
H_BIT) {
4531 ao->
o |= (
num >> 8);
4532 ao->
o |= (
num & 0x000000ff) << 8;
4537 }
else if (strsel ==
B_BIT) {
4539 }
else if (strsel ==
H_BIT) {
4552 if ((
num > 255) || (
num < -255)) {
4558 }
else if (strsel ==
B_BIT) {
4560 }
else if (strsel ==
H_BIT) {
4573 ao->
o |= reg2 << 24;
4579 if ((
num > 255) || (
num < -255)) {
4585 }
else if (strsel ==
B_BIT) {
4587 }
else if (strsel ==
H_BIT) {
4605 if ((reg1 < 8) && (reg2 < 8) && (reg3 < 8) && (!(
m &
DOTW_BIT))) {
4608 }
else if (strsel ==
B_BIT) {
4610 }
else if (strsel ==
H_BIT) {
4616 ao->
o |= reg2 << 11;
4617 ao->
o |= (reg3 & 0x3) << 14;
4618 ao->
o |= (reg3 >> 2);
4621 ao->
a[2][strlen(ao->
a[2]) - 1] =
'\0';
4622 ao->
a[3] =
"lsl 0]";
4631 if (((
shift & 0xffffcfff) != 0) || (reg1 > 15) || (reg2 > 15) || (reg3 > 15)) {
4637 }
else if (strsel ==
B_BIT) {
4639 }
else if (strsel ==
H_BIT) {
4646 ao->
o |= reg2 << 24;
4652 ao->
a[2][strlen(ao->
a[2]) - 1] =
'\0';
4662 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (strsel !=
D_BIT) || (
num > 1023) || (
num < -1023) || ((
num % 4) != 0)) {
4675 ao->
o |= reg3 << 24;
4676 ao->
o |= (
num >> 2) << 8;
4685 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (strsel !=
D_BIT) || (
num > 1023) || (
num < -1023) || ((
num % 4) != 0)) {
4698 ao->
o |= reg3 << 24;
4699 ao->
o |= (
num >> 2) << 8;
4708 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (strsel !=
D_BIT) || (
num > 1023) || (
num < -1023) || ((
num % 4) != 0)) {
4721 ao->
o |= reg3 << 24;
4722 ao->
o |= (
num >> 2) << 8;
4737 if ((strsel ==
D_BIT) || (reg1 > 15) || (reg2 > 15) || (reg3 > 15)) {
4740 if (strsel ==
B_BIT) {
4744 ao->
o |= reg3 << 24;
4746 }
else if (strsel ==
H_BIT) {
4750 ao->
o |= reg3 << 24;
4754 ao->
a[2][strlen(ao->
a[2]) - 1] =
'\0';
4764 if ((strsel != 0) || (reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (
num < 0) || (
num > 1023) || ((
num % 4) != 0)) {
4771 ao->
o |= reg3 << 24;
4772 ao->
o |= (
num >> 2) << 8;
4781 if ((strsel !=
D_BIT) || (reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15)) {
4789 ao->
o |= reg4 << 24;
4805 if ((reg1 > 15) || (reg2 > 15)) {
4809 if ((reg1 == 15) && (reg2 == 14) && (
num < 256)) {
4817 ao->
o |= (
num >> 2) << 8;
4846 ao->
o |= reg2 << 11;
4847 ao->
o |= (
num & 0x3) << 14;
4848 ao->
o |= (
num >> 2);
4852 if ((reg1 < 8) && (reg1 == reg2) && (!(
m &
DOTW_BIT)) && (!(
m &
W_BIT)) && (
num < 256)) {
4874 ao->
o |= reg2 << 24;
4887 if (ao->
a[3] ==
NULL) {
4908 if ((
shift == 0) && (reg1 < 8) && (reg2 < 8) && (reg3 < 8) && (!(
m &
DOTW_BIT))) {
4911 ao->
o |= reg2 << 11;
4912 ao->
o |= (reg3 & 0x3) << 14;
4913 ao->
o |= (reg3 >> 2);
4923 }
else if (
opmask(ao->
op,
"svc", 0)) {
4950 if (ao->
a[3] ==
NULL) {
4958 if ((
shift != 0) && ((
shift & 0x0000f010) != 0x00003000)) {
4964 if (sufsel ==
B_BIT) {
4968 }
else if (sufsel ==
H_BIT) {
4974 ao->
o |= (
shift & 0x00000060) << 7;
4991 if ((reg1 > 15) && (reg2 > 15) && (
shift != 0) && ((
shift & 0x0000f010) != 0x00003000)) {
4995 if (sufsel ==
B_BIT) {
5003 }
else if (sufsel ==
H_BIT) {
5013 ao->
o |= (
shift & 0x00000060) << 7;
5027 if ((reg1 > 15) || (reg2 > 15)) {
5031 if (sufsel ==
B_BIT) {
5033 ao->
o |= reg1 << 24;
5037 ao->
a[1][strlen(ao->
a[1]) - 1] =
'\0';
5038 ao->
a[2] =
"lsl 1]";
5046 if ((reg1 > 15) || (reg2 > 15) || (
shift != 0x00004000) || (sufsel !=
H_BIT)) {
5051 ao->
o |= reg1 << 24;
5058 }
else if ((
m =
opmask(ao->
op,
"teq", 0))) {
5086 }
else if ((
m =
opmask(ao->
op,
"tst", 0))) {
5094 if (
err || (reg1 > 15)) {
5099 ao->
o |= reg1 << 24;
5141 }
else if ((
m =
opmask(ao->
op,
"uasx", 0))) {
5155 }
else if (
opmask(ao->
op,
"ubfx", 0)) {
5164 if ((reg1 > 15) || (reg2 > 15) || (lsb > 31) || ((31 - lsb) <= widthm1)) {
5170 ao->
o |= reg2 << 24;
5171 ao->
o |= (lsb & 0x1c) << 2;
5172 ao->
o |= (lsb & 0x3) << 14;
5173 ao->
o |= widthm1 << 8;
5179 }
else if ((
m =
opmask(ao->
op,
"udiv", 0))) {
5215 }
else if ((
m =
opmask(ao->
op,
"uhasx", 0))) {
5231 }
else if ((
m =
opmask(ao->
op,
"uhsax", 0))) {
5268 }
else if (
opmask(ao->
op,
"umaal", 0)) {
5277 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15)) {
5284 ao->
o |= reg3 << 24;
5291 }
else if (
opmask(ao->
op,
"umlal", 0)) {
5300 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15)) {
5307 ao->
o |= reg3 << 24;
5314 }
else if (
opmask(ao->
op,
"umull", 0)) {
5323 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15)) {
5330 ao->
o |= reg3 << 24;
5359 }
else if ((
m =
opmask(ao->
op,
"uqasx", 0))) {
5374 }
else if ((
m =
opmask(ao->
op,
"uqsax", 0))) {
5411 }
else if ((
m =
opmask(ao->
op,
"usad8", 0))) {
5426 }
else if (
opmask(ao->
op,
"usada8", 0)) {
5435 if ((reg1 > 15) || (reg2 > 15) || (reg3 > 15) || (reg4 > 15)) {
5441 ao->
o |= reg2 << 24;
5458 if ((reg1 > 15) || (
num > 15) || (reg2 > 15)) {
5464 ao->
o |= reg2 << 24;
5478 if ((reg1 > 15) || (
num > 31) || (reg2 > 15) || (
m &
SIXTEEN_BIT) || ((
shift & 0x00001000) != 0)) {
5484 ao->
o |= (
num & 0xf) << 8;
5485 ao->
o |= (
num >> 4) << 12;
5486 ao->
o |= reg2 << 24;
5487 ao->
o |= (
shift & 0x00002000) << 16;
5488 ao->
o |= (
shift & 0x0000c070);
5494 }
else if ((
m =
opmask(ao->
op,
"usax", 0))) {
5544 if (ao->
a[3] ==
NULL) {
5552 if (
shift && ((
shift & 0x0000f010) != 0x00003000)) {
5556 if (sufsel ==
B_BIT) {
5560 }
else if (sufsel ==
H_BIT) {
5566 ao->
o |= (
shift & 0x00000060) << 7;
5577 if ((sufsel ==
B_BIT) || (sufsel ==
H_BIT)) {
5578 if (sufsel ==
B_BIT) {
5595 if ((reg1 > 15) || (reg2 > 15) || (
shift && ((
shift & 0x0000f010) != 0x00003000))) {
5599 if (sufsel ==
B_BIT) {
5603 }
else if (sufsel ==
H_BIT) {
5609 ao->
o |= (
shift & 0x00000060) << 7;
5617 }
else if ((
m =
opmask(ao->
op,
"wfe", 0))) {
5632 }
else if ((
m =
opmask(ao->
op,
"wfi", 0))) {
5647 }
else if ((
m =
opmask(ao->
op,
"yield", 0))) {
5668 for (
i = 0;
i < 0xff;
i++) {
5669 for (j = 0; j < 0xf; j++) {
5685 int i, j, ret,
reg,
a,
b;
5688 int shift, low, high;
5697 if (!strncmp(
ops[
i].
name,
"strex", 5)) {
5708 if (ao->
a[0] && ao->
a[1]) {
5710 strncpy(rn, ao->
a[1], 7);
5713 if ((r0 < 0 || r0 > 15) || (
r1 > 15 ||
r1 < 0)) {
5717 if (!strcmp(
ops[
i].
name,
"strd")) {
5724 char *bracket = strchr(ao->
a[3],
']');
5729 ao->
o |= (
num & 0x0f) << 24;
5730 ao->
o |= ((
num >> 4) & 0x0f) << 16;
5734 if (!strcmp(
ops[
i].
name,
"strh")) {
5762 ao->
o |= (ret & 0x0f) << 8;
5764 ao->
o |= (strstr(
str,
"],")) ? 6 : 7;
5765 ao->
o |= (ret & 0x0f) << 24;
5770 high =
shift & 0xFF00;
5782 ao->
o |= (strstr(
str,
"],")) ? 4 : 5;
5785 ao->
o |= (
num & 0xff) << 24;
5786 ao->
o |= ((
num >> 8) & 0xf) << 16;
5791 if (*ao->
a[0] ==
'{') {
5793 for (j = 0; j < 16; j++) {
5794 if (
reg & (1 << j)) {
5796 ao->
o |= 1 << (24 + j);
5798 ao->
o |= 1 << (8 + j);
5810 if (ret >= 0x00800000 || ret < (
int)0xff800000) {
5814 ao->
o |= ((ret >> 16) & 0xff) << 8;
5815 ao->
o |= ((ret >> 8) & 0xff) << 16;
5816 ao->
o |= ((ret)&0xff) << 24;
5818 RZ_LOG_ERROR(
"assembler: arm: %s: instruction does not accept a register as argument\n",
ops[
i].
name);
5823 ao->
o |= 0x70 << 24;
5826 ao->
o |= ((
n & 0xf) << 24);
5827 ao->
o |= (((
n >> 4) & 0xff) << 16);
5840 ao->
o |= ((
dst >> 16) & 0xff) << 8;
5841 ao->
o |= ((
dst >> 8) & 0xff) << 16;
5842 ao->
o |= ((
dst)&0xff) << 24;
5850 o |= ((
n >> 12) & 0xf) << 8;
5851 o |= ((
n >> 8) & 0xf) << 20;
5852 o |= ((
n >> 4) & 0xf) << 16;
5853 o |= ((
n)&0xf) << 24;
5857 ao->
o |= (
getnum(ao->
a[0]) & 0xff) << 24;
5858 ao->
o |= ((
getnum(ao->
a[0]) >> 8) & 0xff) << 16;
5859 ao->
o |= ((
getnum(ao->
a[0]) >> 16) & 0xff) << 8;
5866 ao->
o |= (
n & 0xf) << 24;
5867 ao->
o |= ((
n >> 4) & 0xff) << 16;
5868 ao->
o |= ((
n >> 12) & 0xf) << 8;
5872 ao->
a[2] = ao->
a[1];
5873 ao->
a[1] = ao->
a[0];
5891 for (
r = 0;
r != 32;
r += 2) {
5892 if (!(
imm & ~0xff)) {
5893 ao->
o |= (
r << 15) | (
imm << 24) | 2;
5899 ao->
o |= (
imm << 24) | 2;
5912 ao->
o |= (
getreg(ao->
a[0]) << 4) << 16;
5913 ao->
o |= (0x90 + a1) << 24;
5915 ao->
o |= (
getreg(ao->
a[2] + 1)) << 8;
5920 if (0xff == ((ao->
o >> 16) & 0xff)) {
5937 ao->
o |= 0xa003 | (immed & 0xff) << 24 | (immed >> 8) << 16;
5948 ao->
o |= 0x3 | ret << 24;
5949 ao->
o |= (ret & 0xf000) >> 4;
5950 ao->
o |= (ret & 0xf00) << 8;
5956 ao->
o |= 0x4003 | ret << 24;
5957 ao->
o |= (ret & 0xf000) >> 4;
5958 ao->
o |= (ret & 0xf00) << 8;
5969 if (ret == -1 ||
a == -1) {
5980 if (low == -1 || high == -1 ||
a == -1 ||
b == -1) {
5988 }
else if (!strncmp(ao->
op,
"smla", 4)) {
5989 if (low > 14 || high > 14 ||
a > 14) {
5993 ao->
o |= high << 24;
6011 if (
b >= 0 &&
b <= 0xff) {
6015 ao->
o |= ((
b & 0xff) << 24);
6016 }
else if (
findyz(
b, &y, &z)) {
6037 ao->
o |= (
n >> 1) << 16;
6042 if (
reg == -1 ||
reg > 14) {
6048 if (
reg == -1 ||
reg > 14) {
6054 if (
reg == -1 ||
reg > 14) {
6061 if (
reg == -1 ||
reg > 14) {
6067 if (
reg == -1 ||
reg > 14) {
6074 if (!strcmp(ao->
a[0],
"le")) {
6076 }
else if (!strcmp(ao->
a[0],
"be")) {
6085 coproc =
getnum(ao->
a[0] + 1);
6086 if (coproc == -1 || coproc > 9) {
6089 ao->
o |= coproc << 16;
6093 if (
opc == -1 ||
opc > 7) {
6099 if (
reg == -1 ||
reg > 14) {
6105 const char *a3 = ao->
a[3];
6108 if (coproc == -1 || coproc > 15) {
6111 ao->
o |= coproc << 8;
6114 const char *a4 = ao->
a[4];
6116 coproc =
getnum(ao->
a[4] + 1);
6117 if (coproc == -1 || coproc > 15) {
6120 ao->
o |= coproc << 24;
6129 ao->
o |= coproc << 29;
6137 if (
reg == -1 ||
reg > 14) {
6143 if (
reg == -1 ||
reg > 14) {
6150 if (!ao->
a[0] || !ao->
a[1]) {
6154 int len = strlen(ao->
a[1]) + 1;
6155 memmove(ao->
a[0] + 1, ao->
a[0], ao->
a[1] - ao->
a[0] +
len);
6158 strncpy(ao->
op,
"rsbs", 5);
6172 if (!ao->
a[0] || !ao->
a[argoff + 1] || !ao->
a[argoff + 2]) {
6176 if (
reg == -1 ||
reg > 15) {
6186 if (width < 1 || width > 0x20 || msb > 0x1f) {
6213 for (
i = j = 0;
i <
sizeof(
buf) - 1 &&
str[j];
i++, j++) {
6214 if (
str[j] ==
'#') {
6223 if (thumb < 0 || thumb > 1) {
6234 void thisplay(
const char *
str) {
6242 void display(
const char *
str) {
6251 thisplay(
"ldmia r1!, {r3, r4, r5}");
6252 thisplay(
"stmia r1!, {r3, r4, r5}");
6253 thisplay(
"bkpt 12");
6255 thisplay(
"sub r1, r2, 0");
6256 thisplay(
"sub r1, r2, 4");
6257 thisplay(
"sub r1, r2, 5");
6258 thisplay(
"sub r1, r2, 7");
6259 thisplay(
"sub r3, 44");
6262 thisplay(
"mov r0, 11");
6263 thisplay(
"mov r0, r2");
6264 thisplay(
"mov r1, r4");
6265 thisplay(
"cmp r1, r2");
6266 thisplay(
"cmp r3, 44");
6269 thisplay(
"add r1, r2");
6270 thisplay(
"add r3, 44");
6271 thisplay(
"sub r1, r2, 3");
6272 thisplay(
"sub r3, 44");
6273 thisplay(
"tst r3,r4");
6278 thisplay(
"and r2,r3");
6283 thisplay(
"ldr r1, [pc, 12]");
6284 thisplay(
"ldr r1, [sp, 24]");
6285 thisplay(
"ldr r1, [r2, r3]");
6291 0: 8991 ldrh
r1, [
r2, #12]
6292 2: 7b11 ldrb
r1, [
r2, #12]
6293 4: 8191 strh
r1, [
r2, #12]
6294 6: 7311 strb
r1, [
r2, #12]
6296 thisplay(
"ldrh r1, [r2, 8]");
6297 thisplay(
"ldrh r1, [r3, 8]");
6298 thisplay(
"ldrh r1, [r4, 16]");
6299 thisplay(
"ldrh r1, [r2, 32]");
6300 thisplay(
"ldrb r1, [r2, 20]");
6301 thisplay(
"strh r1, [r2, 20]");
6302 thisplay(
"strb r1, [r2, 20]");
6303 thisplay(
"str r1, [sp, 20]");
6304 thisplay(
"str r1, [r2, 12]");
6305 thisplay(
"str r1, [r2, r3]");
6308 display(
"mov r0, 33");
6309 display(
"mov r1, 33");
6310 display(
"movne r0, 33");
6311 display(
"tst r0, r1, lsl #2");
6312 display(
"svc 0x80");
6313 display(
"sub r3, r1, r2");
6314 display(
"add r0, r1, r2");
6315 display(
"mov fp, 0");
6316 display(
"pop {pc}");
6317 display(
"pop {r3}");
6322 display(
"pop {pc}");
6323 display(
"add lr, pc, lr");
6324 display(
"adds r3, #8");
6325 display(
"adds r3, r2, #8");
6326 display(
"subs r2, #1");
6327 display(
"cmp r0, r4");
6328 display(
"cmp r7, pc");
6329 display(
"cmp r1, r3");
6330 display(
"mov pc, 44");
6331 display(
"mov pc, r3");
6332 display(
"push {pc}");
6333 display(
"pop {pc}");
6335 display(
"ldr r1, [r2, 33]");
6336 display(
"ldr r1, [r2, r3]");
6337 display(
"ldr r3, [r4, r6]");
6338 display(
"str r1, [pc, 33]");
6339 display(
"str r1, [pc], 2");
6340 display(
"str r1, [pc, 3]");
6341 display(
"str r1, [pc, r4]");
6345 display(
"bne 0x1200");
6346 display(
"str r0, [r1]");
6347 display(
"push {fp,lr}");
6348 display(
"pop {fp,lr}");
6349 display(
"pop {pc}");
6355 display(
"andeq r7, r4, r0, lsr lr");
6356 display(
"andeq r6, r3, r0, ror lr");
6358 display(
"pop {r4,r5,r6,r7,pc}");
6362 display(
"blx 0x8048");
6367 display(
"bl 0x123");
6368 display(
"blt 0x123");
const aarch64_field fields[]
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
static RZ_NULLABLE RzILOpBitVector * shift(RzILOpBitVector *val, RZ_NULLABLE RzILOpBool **carry_out, arm_shifter type, RZ_OWN RzILOpBitVector *dist)
#define THUMB_REG_REG_REG
#define THUMB_COPROC_COREG_BRACKREGBRACK_CONST
#define THUMB_REG_REG_BRACKREGBRACK
#define THUMB_REG_REG_REG_SHIFT
#define THUMB_REG_BRACKREG_CONSTBRACK
#define THUMB_REG_REG_BRACKREGBRACK_CONST
#define THUMB_COPROC_COREG_BRACKREG_CONSTBRACK
#define THUMB_REG_REG_BRACKREG_CONSTBRACK
#define THUMB_REG_REG_REG_BRACKREGBRACK
#define THUMB_OTHER_CONST
#define THUMB_REGBANG_LIST
#define THUMB_REG_REG_BRACKREG_CONSTBRACKBANG
#define THUMB_REG_CONST_CONST
#define THUMB_COPROC_CONST_COREG_COREG_COREG_CONST
#define THUMB_COPROC_COREG_BRACKREG_CONSTBRACKBANG
#define THUMB_COPROC_CONST_REG_REG_COREG
#define THUMB_COPROC_CONST_COREG_COREG_COREG
#define THUMB_REG_CONST_REG_SHIFT
#define THUMB_COPROC_CONST_REG_COREG_COREG_CONST
#define THUMB_REG_REG_CONST_CONST
#define THUMB_REG_BRACKREGBRACK
#define THUMB_REG_REG_CONST
#define THUMB_REG_BRACKREG_REG_SHIFTBRACK
#define THUMB_REG_CONST_REG
#define THUMB_REG_REG_SHIFT
#define THUMB_REG_REG_REG_REG
#define THUMB_BRACKREG_REGBRACK
#define THUMB_BRACKREG_REG_SHIFTBRACK
#define THUMB_REG_BRACKREG_REGBRACK
#define THUMB_COPROC_CONST_REG_COREG_COREG
#define THUMB_COPROC_COREG_BRACKREGBRACK
#define THUMB_REG_BRACKREG_CONSTBRACKBANG
#define THUMB_REG_BRACKREGBRACK_CONST
#define THUMB_BRACKREG_CONSTBRACK
static st32 getnummemend(const char *input)
static ut64 getnum(const char *str)
static st32 getregmemstartend(const char *input)
static st32 getnummemendbang(const char *input)
static ut32 getimmed8(const char *str)
ut32 armass_assemble(const char *str, ut64 off, int thumb)
static ut64 opmask(char *input, char *opcode, ut64 allowed_mask)
static ut32 getthbimmed(st32 number)
static st8 mem_32bit_2reg(ArmOpcode *ao, ut64 m)
static const ut64 C_MATCH_BIT
static char * parse_hints(char *input)
static AssembleFunction assemble[2]
static ut32 itmask(char *input)
static int getcoproc(const char *str)
static char * getrange(char *s)
static void arm_opcode_parse(ArmOpcode *ao, const char *str)
static st32 getregmembang(const char *input)
static st32 firstsigdigit(ut32 num)
static ut8 interpret_msrbank(char *str, ut8 *spsr)
static int arm_opcode_cond(ArmOpcode *ao, int delta)
static const ut64 DOTN_BIT
static st32 getreglist(const char *input)
static ut64 cqcheck(char **input)
static int getcoprocreg(const char *str)
int(* AssembleFunction)(ArmOpcode *, ut64, const char *)
static int strcmpnull(const char *a, const char *b)
static ut32 getthzeroimmed16(ut32 number)
static st32 thumb_getoffset(char *label, ut64 cur)
static st8 std_32bit_3reg(ArmOpcode *ao, ut64 m, bool shift)
static ut32 getthimmed12(const char *str)
static st32 getregmemend(const char *input)
static st8 std_16bit_2reg(ArmOpcode *ao, ut64 m)
static void std_opt_2(ArmOpcode *ao)
static ut64 getnumbang(const char *str)
static int arm_assemble(ArmOpcode *ao, ut64 off, const char *str)
static ut32 getshift(const char *str)
static st8 iflag(char *input)
static void std_opt_3(ArmOpcode *ao)
static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str)
static st32 getlistmask(char *input)
static st32 getshiftmemend(const char *input)
static const ut64 DOTW_BIT
static int getreg(const char *str)
static st32 getregmemstart(const char *input)
static ut64 thumb_selector(char *args[])
static const ut64 SIXTEEN_BIT
static ut32 thumb_getshift(const char *str)
static st8 std_32bit_2reg(ArmOpcode *ao, ut64 m, bool shift)
static int findyz(int x, int *y, int *z)
static const ut64 TWO_BIT
static ut32 getthzeroimmed12(ut32 number)
static const ut64 EIGHT_BIT
static st8 mem_16bit_2reg(ArmOpcode *ao, ut64 m)
static int opstr(RzAsm *a, ut8 *data, const Opcode *op)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
void rotate(unsigned char *list, unsigned len, unsigned rot)
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
static void list(RzEgg *egg)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
int main(int argc, char **argv)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API void rz_mem_swapendian(ut8 *dest, const ut8 *orig, int size)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API int rz_str_casecmp(const char *dst, const char *orig)
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API RZ_BORROW char * rz_str_trim_tail(RZ_NONNULL char *str)
Removes whitespace characters (space, tab, newline etc.) from the end of a string and replaces them w...
RZ_API void rz_str_case(char *str, bool up)
RZ_API size_t rz_str_ncpy(char *dst, const char *src, size_t n)
Secure string copy with null terminator.
RZ_API bool rz_str_startswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string starts with a specifc sequence of characters (case sensitive)
RZ_API bool rz_str_endswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string ends with a specifc sequence of characters (case sensitive)
#define cond(bop, top, mask, flags)
ut32 o
the assembled instruction
static const char * conds[]
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)