Implement MRS
Jeffrey Pfau jeffrey@endrift.com
Thu, 18 Apr 2013 00:06:48 -0700
1 files changed,
8 insertions(+),
2 deletions(-)
jump to
M
src/arm/isa-arm.c
→
src/arm/isa-arm.c
@@ -604,8 +604,14 @@ int32_t mask = (c ? 0x000000FF : 0) | (f ? 0xFF000000 : 0);
mask &= PSR_USER_MASK | PSR_PRIV_MASK | PSR_STATE_MASK; cpu->spsr.packed = (cpu->spsr.packed & ~mask) | (operand & mask);) -DEFINE_INSTRUCTION_ARM(MRS, ARM_STUB) -DEFINE_INSTRUCTION_ARM(MRSR, ARM_STUB) +DEFINE_INSTRUCTION_ARM(MRS, \ + int rd = (opcode >> 12) & 0xF; \ + cpu->gprs[rd] = cpu->cpsr.packed;) + +DEFINE_INSTRUCTION_ARM(MRSR, \ + int rd = (opcode >> 12) & 0xF; \ + cpu->gprs[rd] = cpu->spsr.packed;) + DEFINE_INSTRUCTION_ARM(MSRI, ARM_STUB) DEFINE_INSTRUCTION_ARM(SWI, ARM_STUB)