diff --git a/InstructionSets/M68k/Decoder.cpp b/InstructionSets/M68k/Decoder.cpp index 3ac170c67..457f7d77d 100644 --- a/InstructionSets/M68k/Decoder.cpp +++ b/InstructionSets/M68k/Decoder.cpp @@ -507,6 +507,11 @@ template ::OpT op> uint32_t Predecoder::invali return ~OneOperandMask< AlterableAddressingModesNoAn >::value; + + case OpT(Operation::MOVEfromC): case OpT(Operation::MOVEtoC): + return ~OneOperandMask< + Ext + >::value; } // @@ -1003,6 +1008,14 @@ template ::OpT op, bool validate> Preinstruction Pred // case OpT(Operation::MOVEfromCCR): return validated(combined_mode(ea_mode, ea_register), ea_register); + + // + // MARK: MOVE to/from C. + // + // No further information in the instruction, but an extension word is required. + // + case OpT(Operation::MOVEfromC): case OpT(Operation::MOVEtoC): + return validated(AddressingMode::ExtensionWord); } // @@ -1289,6 +1302,8 @@ Preinstruction Predecoder::decode4(uint16_t instruction) { case 0xe75: Decode(Op::RTS); // 4-169 (p273) case 0xe76: Decode(Op::TRAPV); // 4-191 (p295) case 0xe77: Decode(Op::RTR); // 4-168 (p272) + case 0xe7a: DecodeReq(model >= Model::M68010, Op::MOVEtoC); // 6-22 (p476) + case 0xe7b: DecodeReq(model >= Model::M68010, Op::MOVEfromC); // 6-22 (p476) default: break; } diff --git a/InstructionSets/M68k/Instruction.cpp b/InstructionSets/M68k/Instruction.cpp index 588051ab9..785770336 100644 --- a/InstructionSets/M68k/Instruction.cpp +++ b/InstructionSets/M68k/Instruction.cpp @@ -105,6 +105,8 @@ const char *_to_string(Operation operation, bool is_quick) { case Operation::MOVEfromCCR: return "MOVEfromCCR"; case Operation::MOVEtoUSP: return "MOVEtoUSP"; case Operation::MOVEfromUSP: return "MOVEfromUSP"; + case Operation::MOVEtoC: return "MOVEtoC"; + case Operation::MOVEfromC: return "MOVEfromC"; case Operation::ORItoSR: return "ORItoSR"; case Operation::ORItoCCR: return "ORItoCCR"; diff --git a/InstructionSets/M68k/Instruction.hpp b/InstructionSets/M68k/Instruction.hpp index 2247c70ad..71caf96c7 100644 --- a/InstructionSets/M68k/Instruction.hpp +++ b/InstructionSets/M68k/Instruction.hpp @@ -110,7 +110,8 @@ enum class Operation: uint8_t { // MOVEfromCCR, - MOVEC, MOVES, + MOVEtoC, MOVEfromC, + MOVES, BKPT, RTD, // @@ -205,6 +206,7 @@ constexpr bool requires_supervisor(Operation op) { case Operation::EORItoSR: case Operation::RTE: case Operation::RESET: case Operation::STOP: case Operation::MOVEtoUSP: case Operation::MOVEfromUSP: + case Operation::MOVEtoC: case Operation::MOVEfromC: case Operation::MOVEtoSR: return true;