From bbe3c0724da63cb266e2d7b0a1e9e0dc6ff156ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Fri, 28 Jan 2022 16:58:35 +0100 Subject: [PATCH] Add sb (= r9) alias to arm assembler (#2260) --- librz/asm/arch/arm/armass.c | 4 ++-- test/db/asm/arm_16 | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/librz/asm/arch/arm/armass.c b/librz/asm/arch/arm/armass.c index aa9d673e24..442b719ef6 100644 --- a/librz/asm/arch/arm/armass.c +++ b/librz/asm/arch/arm/armass.c @@ -615,7 +615,7 @@ static char *getrange(char *s) { static int getreg(const char *str) { int i; char *ep; - const char *aliases[] = { "sl", "fp", "ip", "sp", "lr", "pc", NULL }; + const char *aliases[] = { "sb", "sl", "fp", "ip", "sp", "lr", "pc", NULL }; if (!str || !*str) { return -1; } @@ -630,7 +630,7 @@ static int getreg(const char *str) { } for (i = 0; aliases[i]; i++) { if (!strcmpnull(str, aliases[i])) { - return 10 + i; + return 9 + i; } } return -1; diff --git a/test/db/asm/arm_16 b/test/db/asm/arm_16 index d10d761258..c90381bf28 100755 --- a/test/db/asm/arm_16 +++ b/test/db/asm/arm_16 @@ -9,6 +9,7 @@ a "bl -0x2a" fff7e9ff d "bl 0xffffffd6" fff7e9ff ad "mov fp, r1" 8b46 a "mov r9, r1" 8946 +ad "mov sb, r1" 8946 a "mov r4, r1" 0c46 ad "add sp, 0x10" 04b0 a "add sp, 0x16" 0df1160d