fix: PC is 12 ahead when it is rd in str and strb
This commit is contained in:
parent
7bfb87a859
commit
c52dc5adb1
|
@ -38,11 +38,12 @@ pub fn singleDataTransfer(comptime I: bool, comptime P: bool, comptime U: bool,
|
||||||
} else {
|
} else {
|
||||||
if (B) {
|
if (B) {
|
||||||
// STRB
|
// STRB
|
||||||
bus.write8(address, @truncate(u8, cpu.r[rd]));
|
const value = if (rd == 0xF) cpu.r[rd] + 8 else cpu.r[rd];
|
||||||
|
bus.write8(address, @truncate(u8, value));
|
||||||
} else {
|
} else {
|
||||||
// STR
|
// STR
|
||||||
const force_aligned = address & 0xFFFF_FFFC;
|
const value = if (rd == 0xF) cpu.r[rd] + 8 else cpu.r[rd];
|
||||||
bus.write32(force_aligned, cpu.r[rd]);
|
bus.write32(address & 0xFFFF_FFFC, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue