1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-03 11:30:02 +00:00

Adds tests for MOVE.l (An), Dn, and thereby correct their implementation.

This commit is contained in:
Thomas Harte 2019-03-23 21:41:47 -04:00
parent 43532c8455
commit 47359dc8f1
2 changed files with 10 additions and 1 deletions

View File

@ -127,6 +127,9 @@ class RAM68000: public CPU::MC68000::BusHandler {
0x3040, // MOVEA D0, A0
0x3278, 0x0400, // MOVEA.w (0x0400), A1
0x387c, 0x0400, // MOVE #$400, A4
0x2414, // MOVE.l (A4), D2
});
// Perform RESET.
@ -153,6 +156,12 @@ class RAM68000: public CPU::MC68000::BusHandler {
_machine->run_for(Cycles(13));
state = _machine->get_processor_state();
XCTAssert(state.address[1] == 0x0000303c, "A1 was %08x instead of 0x0000303c", state.address[1]);
// Perform MOVE #$400, A4, MOVE.l (A4), D2
_machine->run_for(Cycles(20));
state = _machine->get_processor_state();
XCTAssert(state.address[4] == 0x0400, "A4 was %08x instead of 0x00000400", state.address[4]);
XCTAssert(state.data[2] == 0x303cfb2e, "D2 was %08x instead of 0x303cfb2e", state.data[2]);
}
@end

View File

@ -445,7 +445,7 @@ struct ProcessorStorageConstructor {
operation = Operation::MOVEAl;
case 0x10200: // MOVE.l (An), Dn
case 0x10300: // MOVE.l (An)+, Dn
op(Action::CopySourceToEffectiveAddress, seq("nR nr np"));
op(Action::CopySourceToEffectiveAddress, seq("nR nr np", {&storage_.effective_address_[0], &storage_.effective_address_[0]}));
if(source_mode == 0x3) {
op(int(Action::Increment4) | MicroOp::SourceMask);
}