Implement B
Jeffrey Pfau jeffrey@endrift.com
Sat, 13 Apr 2013 12:38:47 -0700
1 files changed,
5 insertions(+),
1 deletions(-)
jump to
M
src/isa-thumb.c
→
src/isa-thumb.c
@@ -358,7 +358,11 @@ cpu->gprs[ARM_SP] = address + 4)
DEFINE_INSTRUCTION_THUMB(ILL, ARM_STUB) DEFINE_INSTRUCTION_THUMB(BKPT, ARM_STUB) -DEFINE_INSTRUCTION_THUMB(B, ARM_STUB) +DEFINE_INSTRUCTION_THUMB(B, \ + int16_t immediate = (opcode & 0x07FF) << 5; \ + cpu->gprs[ARM_PC] += (((int32_t) immediate) >> 4); \ + THUMB_WRITE_PC;) + DEFINE_INSTRUCTION_THUMB(BL1, \ int16_t immediate = (opcode & 0x07FF) << 5; \ cpu->gprs[ARM_LR] = cpu->gprs[ARM_PC] + (((int32_t) immediate) << 7);)