1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-26 15:32:04 +00:00

Correct source counting, but this leaves the operands still being the wrong way around.

This commit is contained in:
Thomas Harte 2022-05-05 21:06:53 -04:00
parent f7991e18de
commit 06fe320cc0
2 changed files with 5 additions and 9 deletions

View File

@ -485,14 +485,6 @@ void Executor<model, BusHandler>::movem(Preinstruction instruction, uint32_t sou
} else {
// Move memory to registers.
if(instruction.mode<0>() == AddressingMode::AddressRegisterIndirectWithPostincrement) {
// If the effective address is specified by the postincrement mode ...
// [i]f the addressing register is also loaded from memory, the memory value is
// ignored and the register is written with the postincremented effective address.
source -= 2;
}
int index = 0;
while(dest) {
if(dest & 1) {
@ -508,6 +500,10 @@ void Executor<model, BusHandler>::movem(Preinstruction instruction, uint32_t sou
}
if(instruction.mode<0>() == AddressingMode::AddressRegisterIndirectWithPostincrement) {
// If the effective address is specified by the postincrement mode ...
// [i]f the addressing register is also loaded from memory, the memory value is
// ignored and the register is written with the postincremented effective address.
registers_[8 + instruction.reg<0>()].l = source;
}
}

View File

@ -73,7 +73,7 @@
- (void)setUp {
// To limit tests run to a subset of files and/or of tests, uncomment and fill in below.
_fileSet = [NSSet setWithArray:@[@"movem.json"]];
// _testSet = [NSSet setWithArray:@[@"MOVEM 0060 (0)"]];
_testSet = [NSSet setWithArray:@[@"MOVEM 00a8 (0)"]];
// _fileSet = [NSSet setWithArray:@[@"jmp_jsr.json"]];
// _testSet = [NSSet setWithArray:@[@"CHK 41a8"]];
}