all repos — mgba @ 71c68fe79f380fa6e1a33809752d5a912dca75c6

mGBA Game Boy Advance Emulator

Implement ADD(6)
Jeffrey Pfau jeffrey@endrift.com
Fri, 12 Apr 2013 19:59:55 -0700
commit

71c68fe79f380fa6e1a33809752d5a912dca75c6

parent

21df1c48c2bbe82c63fe5b7ef73d7f0cc98a5b82

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M src/isa-thumb.csrc/isa-thumb.c

@@ -170,6 +170,7 @@

#define DEFINE_IMMEDIATE_WITH_REGISTER_EX_THUMB(NAME, RD, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \ int rd = RD; \ + int immediate = (opcode & 0x00FF) << 2; \ BODY;) #define DEFINE_IMMEDIATE_WITH_REGISTER_THUMB(NAME, BODY) \

@@ -180,7 +181,7 @@ DEFINE_IMMEDIATE_WITH_REGISTER_THUMB(LDR4, ARM_STUB)

DEFINE_IMMEDIATE_WITH_REGISTER_THUMB(STR3, ARM_STUB) DEFINE_IMMEDIATE_WITH_REGISTER_THUMB(ADD5, ARM_STUB) -DEFINE_IMMEDIATE_WITH_REGISTER_THUMB(ADD6, ARM_STUB) +DEFINE_IMMEDIATE_WITH_REGISTER_THUMB(ADD6, cpu->gprs[rd] = cpu->gprs[ARM_SP] + immediate) #define DEFINE_LOAD_STORE_WITH_REGISTER_EX_THUMB(NAME, RM, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \