From a88be030a17125af3467db72b72080cca539744b Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 14 Jun 2011 22:46:24 +0000 Subject: [PATCH] Improving ARM support --- src/arch/arm.h | 9 +++++++++ test/arm.S | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/arch/arm.h b/src/arch/arm.h index 71f780f..eb52b05 100644 --- a/src/arch/arm.h +++ b/src/arch/arm.h @@ -39,6 +39,15 @@ static int _arm_write(ArchPlugin * plugin, ArchInstruction * instruction, switch(instruction->opcode & 0x0fffffff) /* ignore condition code */ { + /* branch and exchange */ + case OPBX(0): + /* first operand, Rn */ + p = call->operands[0].value._register.name; + if((ar = helper->get_register_by_name_size(helper->arch, + p, 32)) == NULL) + return -1; + opcode |= ar->id; + break; /* data processing */ case OPDP(0, and): case OPDP(0, eor): diff --git a/test/arm.S b/test/arm.S index 21fb409..b5e3aba 100644 --- a/test/arm.S +++ b/test/arm.S @@ -36,8 +36,8 @@ biceqs %r3, %r4, $0x1 bl $0xa0 bleq $0xa0 - bx %r0 - bxeq %r0 + bx %r1 + bxeq %r2 cmn %r5, %r4 cmneq %r5, %r4 cmn %r5, $0x1