Implement MOV(1)
Jeffrey Pfau jeffrey@endrift.com
Fri, 12 Apr 2013 02:44:04 -0700
1 files changed,
6 insertions(+),
1 deletions(-)
jump to
M
src/isa-thumb.c
→
src/isa-thumb.c
@@ -16,6 +16,10 @@
// Instruction definitions // Beware pre-processor insanity +#define THUMB_NEUTRAL_S(M, N, D) \ + cpu->cpsr.n = ARM_SIGN(D); \ + cpu->cpsr.z = !(D); + #define APPLY(F, ...) F(__VA_ARGS__) #define COUNT_1(EMITTER, PREFIX, ...) \@@ -113,6 +117,7 @@
#define DEFINE_DATA_FORM_3_INSTRUCTION_EX_THUMB(NAME, RD, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \ int rd = RD; \ + int immediate = opcode & 0x00FF; \ BODY;) #define DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(NAME, BODY) \@@ -120,7 +125,7 @@ COUNT_3(DEFINE_DATA_FORM_3_INSTRUCTION_EX_THUMB, NAME ## _R, BODY)
DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(ADD2, ARM_STUB) DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(CMP1, ARM_STUB) -DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(MOV1, ARM_STUB) +DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(MOV1, cpu->gprs[rd] = immediate; THUMB_NEUTRAL_S(, , cpu->gprs[rd])) DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(SUB2, ARM_STUB) #define DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(NAME, BODY) \