From c50556dde460721b696cd97b7dff2a1273600ad4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 12 Apr 2022 08:16:29 -0400 Subject: [PATCH] Create empty line decoders. --- InstructionSets/68k/Decoder.cpp | 70 +++++++++++++++++++++++++++++++++ InstructionSets/68k/Decoder.hpp | 12 ++++++ 2 files changed, 82 insertions(+) diff --git a/InstructionSets/68k/Decoder.cpp b/InstructionSets/68k/Decoder.cpp index 76f7b40e0..393940b2c 100644 --- a/InstructionSets/68k/Decoder.cpp +++ b/InstructionSets/68k/Decoder.cpp @@ -132,6 +132,26 @@ template Preinstruction Predecoder::decode(uint16_t instru // MARK: - Page decoders. +Preinstruction Predecoder::decode0(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decode1(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decode2(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decode3(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + Preinstruction Predecoder::decode4(uint16_t instruction) { switch(instruction & 0xfff) { case 0xe70: return decode(instruction); // 6-83 (p537) @@ -228,6 +248,21 @@ Preinstruction Predecoder::decode4(uint16_t instruction) { return Preinstruction(); } +Preinstruction Predecoder::decode5(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decode6(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decode7(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + Preinstruction Predecoder::decode8(uint16_t instruction) { // 4-171 (p275) if((instruction & 0x1f0) == 0x100) return decode(instruction); @@ -249,6 +284,15 @@ Preinstruction Predecoder::decode8(uint16_t instruction) { return Preinstruction(); } +Preinstruction Predecoder::decode9(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decodeA(uint16_t) { + return Preinstruction(); +} + Preinstruction Predecoder::decodeB(uint16_t instruction) { // 4-100 (p204) switch(instruction & 0x0c0) { @@ -302,15 +346,41 @@ Preinstruction Predecoder::decodeC(uint16_t instruction) { return Preinstruction(); } +Preinstruction Predecoder::decodeD(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decodeE(uint16_t instruction) { + (void)instruction; + return Preinstruction(); +} + +Preinstruction Predecoder::decodeF(uint16_t) { + return Preinstruction(); +} + // MARK: - Main decoder. Preinstruction Predecoder::decode(uint16_t instruction) { // Divide first based on line. switch(instruction & 0xf000) { + case 0x0000: return decode0(instruction); + case 0x1000: return decode1(instruction); + case 0x2000: return decode2(instruction); + case 0x3000: return decode3(instruction); case 0x4000: return decode4(instruction); + case 0x5000: return decode5(instruction); + case 0x6000: return decode6(instruction); + case 0x7000: return decode7(instruction); case 0x8000: return decode8(instruction); + case 0x9000: return decode9(instruction); + case 0xa000: return decodeA(instruction); case 0xb000: return decodeB(instruction); case 0xc000: return decodeC(instruction); + case 0xd000: return decodeD(instruction); + case 0xe000: return decodeE(instruction); + case 0xf000: return decodeF(instruction); default: break; } diff --git a/InstructionSets/68k/Decoder.hpp b/InstructionSets/68k/Decoder.hpp index 16ef91505..421fbd886 100644 --- a/InstructionSets/68k/Decoder.hpp +++ b/InstructionSets/68k/Decoder.hpp @@ -26,10 +26,22 @@ class Predecoder { private: // Page by page decoders; each gets a bit ad hoc so // it is neater to separate them. + Preinstruction decode0(uint16_t instruction); + Preinstruction decode1(uint16_t instruction); + Preinstruction decode2(uint16_t instruction); + Preinstruction decode3(uint16_t instruction); Preinstruction decode4(uint16_t instruction); + Preinstruction decode5(uint16_t instruction); + Preinstruction decode6(uint16_t instruction); + Preinstruction decode7(uint16_t instruction); Preinstruction decode8(uint16_t instruction); + Preinstruction decode9(uint16_t instruction); + Preinstruction decodeA(uint16_t instruction); Preinstruction decodeB(uint16_t instruction); Preinstruction decodeC(uint16_t instruction); + Preinstruction decodeD(uint16_t instruction); + Preinstruction decodeE(uint16_t instruction); + Preinstruction decodeF(uint16_t instruction); // Specific instruction decoders. template Preinstruction decode(uint16_t instruction);