Skip to content

Commit

Permalink
Add REV and others to Rasm2, related to bug #7250 (#9365)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscherer authored and radare committed Feb 12, 2018
1 parent e46939e commit 8c683ea
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libr/asm/arch/arm/armass.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum {
TYPE_ENDIAN = 17,
TYPE_MUL = 18,
TYPE_CLZ = 19,
TYPE_REV = 20,
};

static int strcmpnull(const char *a, const char *b) {
Expand Down Expand Up @@ -139,6 +140,11 @@ static ArmOp ops[] = {
{"lsl", 0x1000a0e1, TYPE_SHFT},
{"ror", 0x7000a0e1, TYPE_SHFT},

{"rev16", 0xb00fbf06, TYPE_REV},
{"revsh", 0xb00fff06, TYPE_REV},
{"rev", 0x300fbf06, TYPE_REV},
{"rbit", 0x300fff06, TYPE_REV},

{"mrc", 0x100010ee, TYPE_COPROC},
{"setend", 0x000001f1, TYPE_ENDIAN},
{ "clz", 0x000f6f01, TYPE_CLZ},
Expand Down Expand Up @@ -1335,6 +1341,20 @@ static int arm_assemble(ArmOpcode *ao, ut64 off, const char *str) {
return 0;
}
ao->o |= reg << 24;
break;
case TYPE_REV:
reg = getreg (ao->a[0]);
if (reg == -1 || reg > 14) {
return 0;
}
ao->o |= reg << 20;

reg = getreg (ao->a[1]);
if (reg == -1 || reg > 14) {
return 0;
}
ao->o |= reg << 24;

break;
case TYPE_ENDIAN:
if (!strcmp (ao->a[0], "le")) {
Expand Down

0 comments on commit 8c683ea

Please sign in to comment.