cpu/arm: fix single data transfer
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
@@ -171,10 +171,6 @@ Instruction::exec(Cpu& cpu) {
|
|||||||
cpu.cpsr.set_c(carry);
|
cpu.cpsr.set_c(carry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// PC is always two instructions ahead
|
|
||||||
if (data.rn == cpu.PC_INDEX)
|
|
||||||
address -= 2 * INSTRUCTION_SIZE;
|
|
||||||
|
|
||||||
if (data.pre)
|
if (data.pre)
|
||||||
address += (data.up ? offset : -offset);
|
address += (data.up ? offset : -offset);
|
||||||
|
|
||||||
|
@@ -319,9 +319,9 @@ TEST_CASE_METHOD(CpuFixture, "Single Data Transfer", TAG) {
|
|||||||
|
|
||||||
exec(data);
|
exec(data);
|
||||||
|
|
||||||
CHECK(bus.read_word(0x300352A - 2 * INSTRUCTION_SIZE) == 61119);
|
CHECK(bus.read_word(0x300352A) == 61119);
|
||||||
// 0x300352A - 0xDA1
|
// 0x300352A - 0xDA1
|
||||||
CHECK(getr(15) == 0x3002789 - 2 * INSTRUCTION_SIZE);
|
CHECK(getr(15) == 0x3002789);
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
data_transfer->rn = 7;
|
data_transfer->rn = 7;
|
||||||
|
Reference in New Issue
Block a user