Implement addressing mode 1 ROR immediate
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Apr 2013 01:54:57 -0700
1 files changed,
8 insertions(+),
1 deletions(-)
jump to
M
src/arm/isa-arm.c
→
src/arm/isa-arm.c
@@ -64,7 +64,14 @@
static inline void _shiftROR(struct ARMCore* cpu, uint32_t opcode) { int rm = opcode & 0x0000000F; int immediate = (opcode & 0x00000F80) >> 7; - ARM_STUB; + if (immediate) { + cpu->shifterOperand = ARM_ROR(cpu->gprs[rm], immediate); + cpu->shifterCarryOut = cpu->gprs[rm] & (1 << (immediate - 1)); + } else { + // RRX + cpu->shifterOperand = (cpu->cpsr.c << 31) | (((uint32_t) cpu->gprs[rm]) >> 1); + cpu->shifterCarryOut = cpu->gprs[rm] & 0x00000001; + } } static inline void _shiftRORR(struct ARMCore* cpu, uint32_t opcode) {