all repos — mgba @ fdf36f58202684402587ff2e9bf9346ff5ed8be9

mGBA Game Boy Advance Emulator

Implement MRS
Jeffrey Pfau jeffrey@endrift.com
Thu, 18 Apr 2013 00:06:48 -0700
commit

fdf36f58202684402587ff2e9bf9346ff5ed8be9

parent

b3832205fcbd5632124e3c5a1fca2282bf142f7e

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

jump to
M src/arm/isa-arm.csrc/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)