diff --git a/Processors/68000/Implementation/68000Storage.cpp b/Processors/68000/Implementation/68000Storage.cpp index fa2d0f85e..7c62920b1 100644 --- a/Processors/68000/Implementation/68000Storage.cpp +++ b/Processors/68000/Implementation/68000Storage.cpp @@ -244,9 +244,9 @@ struct ProcessorStorageConstructor { {0xff00, 0x0600, Operation::ADD, Decoder::DataSizeModeQuick}, // 4-11 (p115) - {0x1000, 0xf000, Operation::MOVEb, Decoder::RegisterModeModeRegister}, // 4-116 (p220) - {0x3000, 0xf000, Operation::MOVEw, Decoder::RegisterModeModeRegister}, // 4-116 (p220) - {0x2000, 0xf000, Operation::MOVEl, Decoder::RegisterModeModeRegister}, // 4-116 (p220) + {0xf000, 0x1000, Operation::MOVEb, Decoder::RegisterModeModeRegister}, // 4-116 (p220) + {0xf000, 0x2000, Operation::MOVEl, Decoder::RegisterModeModeRegister}, // 4-116 (p220) + {0xf000, 0x3000, Operation::MOVEw, Decoder::RegisterModeModeRegister}, // 4-116 (p220) }; std::vector micro_op_pointers(65536, std::numeric_limits::max()); @@ -263,6 +263,7 @@ struct ProcessorStorageConstructor { const auto micro_op_start = storage_.all_micro_ops_.size(); switch(mapping.decoder) { + // Decodes the format used by ABCD and SBCD. case Decoder::Decimal: { const int destination = (instruction >> 9) & 7; const int source = instruction & 7; @@ -286,6 +287,31 @@ struct ProcessorStorageConstructor { } } break; + // Decodes the format used by all the MOVEs. + case Decoder::RegisterModeModeRegister: { + const int source_register = instruction & 7; + const int source_mode = (instruction >> 3) & 7; + + const int destination_mode = (instruction >> 6) & 7; + const int destination_register = (instruction >> 9) & 7; + + if(!source_mode) { + storage_.instructions[instruction].source = &storage_.data_[source_register]; + } + + if(!destination_mode) { + storage_.instructions[instruction].destination = &storage_.data_[destination_register]; + } + + // TODO: all other types of mode. + if(!destination_mode && !source_mode) { + storage_.all_micro_ops_.emplace_back(Action::PerformOperation, &arbitrary_base + assemble_program("np")); + storage_.all_micro_ops_.emplace_back(); + } else { + continue; + } + } break; + default: std::cerr << "Unhandled decoder " << int(mapping.decoder) << std::endl; continue;