Implement ADD(1)

This commit is contained in:
Jeffrey Pfau 2013-04-12 22:17:37 -07:00
parent d7ddbee448
commit 9f77c32375
1 changed files with 7 additions and 1 deletions

View File

@ -122,12 +122,18 @@ DEFINE_DATA_FORM_1_INSTRUCTION_THUMB(SUB, ARM_STUB)
#define DEFINE_DATA_FORM_2_INSTRUCTION_EX_THUMB(NAME, IMMEDIATE, BODY) \
DEFINE_INSTRUCTION_THUMB(NAME, \
int immediate = IMMEDIATE; \
int rd = opcode & 0x0007; \
int rn = (opcode >> 3) & 0x0007; \
BODY;)
#define DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(NAME, BODY) \
COUNT_3(DEFINE_DATA_FORM_2_INSTRUCTION_EX_THUMB, NAME ## 1_, BODY)
DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(ADD, ARM_STUB)
DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(ADD, \
int n = cpu->gprs[rn]; \
cpu->gprs[rd] = n + immediate; \
THUMB_ADDITION_S(n, immediate, cpu->gprs[rd]))
DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(SUB, ARM_STUB)
#define DEFINE_DATA_FORM_3_INSTRUCTION_EX_THUMB(NAME, RD, BODY) \