From 5aabe01b6d3eb2d94a92b5d5613edb3d42463191 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 4 May 2022 08:41:55 -0400 Subject: [PATCH] Mostly fix LINK and UNLK. --- InstructionSets/M68k/Instruction.hpp | 4 ++-- .../Mac/Clock SignalTests/68000ComparativeTests.mm | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/InstructionSets/M68k/Instruction.hpp b/InstructionSets/M68k/Instruction.hpp index af3704339..2fd3ccb0b 100644 --- a/InstructionSets/M68k/Instruction.hpp +++ b/InstructionSets/M68k/Instruction.hpp @@ -275,7 +275,6 @@ template uint8_t ope case Operation::EORItoSR: case Operation::EORItoCCR: case Operation::Bccb: case Operation::Bccw: case Operation::Bccl: case Operation::BSRb: case Operation::BSRw: case Operation::BSRl: - case Operation::UNLINK: return FetchOp1; // @@ -294,6 +293,7 @@ template uint8_t ope case Operation::NEGXb: case Operation::NEGXw: case Operation::NEGXl: case Operation::EXTbtow: case Operation::EXTwtol: case Operation::SWAP: + case Operation::UNLINK: return FetchOp1 | StoreOp1; // @@ -312,7 +312,6 @@ template uint8_t ope case Operation::CMPb: case Operation::CMPw: case Operation::CMPl: case Operation::CMPAw: case Operation::CMPAl: case Operation::CHK: - case Operation::LINKw: return FetchOp1 | FetchOp2; // @@ -343,6 +342,7 @@ template uint8_t ope // Two-operand; read both, write source. // case Operation::DBcc: + case Operation::LINKw: return FetchOp1 | FetchOp2 | StoreOp1; // diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index b6c610fda..8a91764b7 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -41,6 +41,15 @@ // eori_andi_ori // lea +// Issues to fix: +// +// LINK A7, in which the post-operation writeback overwrites +// the modified value. +// +// Do I need a dedicated LINKA7 operation? +// +// This affects link_unlk + // Skipped for now, for implying a more granular decoder: // // btst_bchg_bclr_bset @@ -60,7 +69,7 @@ - (void)setUp { // To limit tests run to a subset of files and/or of tests, uncomment and fill in below. _fileSet = [NSSet setWithArray:@[@"link_unlk.json"]]; -// _testSet = [NSSet setWithArray:@[@"EXT/EXTB 0031"]]; + _testSet = [NSSet setWithArray:@[@"LINK.w 0007"]]; // _fileSet = [NSSet setWithArray:@[@"jmp_jsr.json"]]; // _testSet = [NSSet setWithArray:@[@"CHK 41a8"]]; }