fix: only add +4 to rn register when dealing with r15
This commit is contained in:
parent
6da9e965bb
commit
348df3dbe4
|
@ -15,7 +15,7 @@ pub fn halfAndSignedDataTransfer(comptime P: bool, comptime U: bool, comptime I:
|
||||||
const rm = opcode & 0xF;
|
const rm = opcode & 0xF;
|
||||||
const imm_offset_high = opcode >> 8 & 0xF;
|
const imm_offset_high = opcode >> 8 & 0xF;
|
||||||
|
|
||||||
const base = cpu.r[rn] + if (!L) 4 else @as(u32, 0);
|
const base = cpu.r[rn] + if (!L and rn == 0xF) 4 else @as(u32, 0);
|
||||||
const offset = if (I) imm_offset_high << 4 | rm else cpu.r[rm];
|
const offset = if (I) imm_offset_high << 4 | rm else cpu.r[rm];
|
||||||
|
|
||||||
const modified_base = if (U) base +% offset else base -% offset;
|
const modified_base = if (U) base +% offset else base -% offset;
|
||||||
|
|
Loading…
Reference in New Issue