mirror of https://github.com/mgba-emu/mgba.git
Implement ADD(1)
This commit is contained in:
parent
d7ddbee448
commit
9f77c32375
|
@ -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) \
|
||||
|
|
Loading…
Reference in New Issue