From 06fe320cc028644687c610891c26839d9f388686 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 5 May 2022 21:06:53 -0400 Subject: [PATCH] Correct source counting, but this leaves the operands still being the wrong way around. --- .../M68k/Implementation/ExecutorImplementation.hpp | 12 ++++-------- .../Mac/Clock SignalTests/68000ComparativeTests.mm | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp b/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp index b1f06f0de..f40d7d5d5 100644 --- a/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp +++ b/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp @@ -485,14 +485,6 @@ void Executor::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::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; } } diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index 06df19fe0..775b17658 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -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"]]; }