From bca18e7abab5efddc2e783d58b12edeca37f14d8 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 12 Apr 2022 08:44:32 -0400 Subject: [PATCH] Fill in line decoders for 5, 6 and 7. This leaves 9, D and E to go. --- InstructionSets/68k/Decoder.cpp | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/InstructionSets/68k/Decoder.cpp b/InstructionSets/68k/Decoder.cpp index 927110904..61bae1455 100644 --- a/InstructionSets/68k/Decoder.cpp +++ b/InstructionSets/68k/Decoder.cpp @@ -131,6 +131,8 @@ template Preinstruction Predecoder::decode(uint16_t instru // TODO: be careful that decoders for ADD, SUB, etc, must check the instruction a little // further to determine whether they're ADDI, SUBI, etc or the regular versions. + + // TODO: be willing to mutate Scc into DBcc. } // MARK: - Page decoders. @@ -325,18 +327,37 @@ Preinstruction Predecoder::decode4(uint16_t instruction) { } Preinstruction Predecoder::decode5(uint16_t instruction) { - (void)instruction; + switch(instruction & 0x1c0) { + // 4-11 (p115) + case 0x000: return decode(instruction); + case 0x040: return decode(instruction); + case 0x080: return decode(instruction); + + // 4-181 (p285) + case 0x100: return decode(instruction); + case 0x140: return decode(instruction); + case 0x180: return decode(instruction); + + default: break; + } + + switch(instruction & 0x0c0) { + // 4-173 (p276), though this'll also hit DBcc 4-91 (p195) + case 0x0c0: return decode(instruction); + + default: break; + } return Preinstruction(); } Preinstruction Predecoder::decode6(uint16_t instruction) { - (void)instruction; - return Preinstruction(); + // 4-25 (p129), 4-59 (p163) and 4-55 (p159) + return decode(instruction); } Preinstruction Predecoder::decode7(uint16_t instruction) { - (void)instruction; - return Preinstruction(); + // 4-134 (p238) + return decode(instruction); } Preinstruction Predecoder::decode8(uint16_t instruction) {