Implement BL

This commit is contained in:
Jeffrey Pfau 2013-04-11 03:14:09 -07:00
parent 133d574667
commit d90d7d1899

View File

@ -291,8 +291,17 @@ DEFINE_LOAD_STORE_MULTIPLE_EX_THUMB(PUSHR, \
DEFINE_INSTRUCTION_THUMB(ILL, ARM_STUB)
DEFINE_INSTRUCTION_THUMB(BKPT, ARM_STUB)
DEFINE_INSTRUCTION_THUMB(B, ARM_STUB)
DEFINE_INSTRUCTION_THUMB(BL1, ARM_STUB)
DEFINE_INSTRUCTION_THUMB(BL2, ARM_STUB)
DEFINE_INSTRUCTION_THUMB(BL1, \
int16_t immediate = (opcode & 0x07FF) << 7; \
cpu->gprs[ARM_LR] = cpu->gprs[ARM_PC] + (((int32_t) immediate) << 4);)
DEFINE_INSTRUCTION_THUMB(BL2, \
uint16_t immediate = (opcode & 0x07FF) << 1; \
uint32_t pc = cpu->gprs[ARM_PC]; \
cpu->gprs[ARM_PC] = cpu->gprs[ARM_LR] + immediate; \
cpu->gprs[ARM_LR] = pc - 1; \
THUMB_WRITE_PC;)
DEFINE_INSTRUCTION_THUMB(BX, ARM_STUB)
DEFINE_INSTRUCTION_THUMB(SWI, ARM_STUB)