fix(cpu): force-align SWP reads and writes
This commit is contained in:
parent
9581e3b3cb
commit
adfd501fc4
|
@ -20,8 +20,8 @@ pub fn singleDataSwap(comptime B: bool) InstrFn {
|
||||||
cpu.r[rd] = value;
|
cpu.r[rd] = value;
|
||||||
} else {
|
} else {
|
||||||
// SWP
|
// SWP
|
||||||
const value = std.math.rotr(u32, bus.read32(address), 8 * (address & 0x3));
|
const value = std.math.rotr(u32, bus.read32(address & 0xFFFF_FFFC), 8 * (address & 0x3));
|
||||||
bus.write32(address, cpu.r[rm]);
|
bus.write32(address & 0xFFFF_FFFC, cpu.r[rm]);
|
||||||
cpu.r[rd] = value;
|
cpu.r[rd] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue