diff --git a/Processors/68000/Implementation/68000Storage.cpp b/Processors/68000/Implementation/68000Storage.cpp index 3a969b39f..81e237e6e 100644 --- a/Processors/68000/Implementation/68000Storage.cpp +++ b/Processors/68000/Implementation/68000Storage.cpp @@ -2206,6 +2206,18 @@ CPU::MC68000::ProcessorStorage::ProcessorStorage() { const size_t dbcc_condition_false_no_branch_offset = constructor.assemble_program("n nr np np", { &dbcc_false_address_ }); const size_t dbcc_condition_false_branch_offset = constructor.assemble_program("n np np"); + // The reads steps needs to be 33 neatly assembled reads; the writes just the 32. + // Addresses and data sources/targets will be filled in at runtime, so anything will do here. + std::string movem_reads_pattern, movem_writes_pattern; + std::vector addresses; + for(auto c = 0; c < 33; ++c) { + movem_reads_pattern += "nr "; + if(c != 32) movem_writes_pattern += "nw "; + addresses.push_back(nullptr); + } + const size_t movem_reads_offset = constructor.assemble_program(movem_reads_pattern, addresses); + const size_t movem_writes_offset = constructor.assemble_program(movem_writes_pattern, addresses); + // Install operations. constructor.install_instructions(); @@ -2220,6 +2232,9 @@ CPU::MC68000::ProcessorStorage::ProcessorStorage() { dbcc_condition_false_no_branch_steps_ = &all_bus_steps_[dbcc_condition_false_no_branch_offset]; dbcc_condition_false_branch_steps_ = &all_bus_steps_[dbcc_condition_false_branch_offset]; + movem_reads_steps_ = &all_bus_steps_[movem_reads_offset]; + movem_writes_steps_ = &all_bus_steps_[movem_writes_offset]; + // Set initial state. Largely TODO. active_step_ = reset_bus_steps_; effective_address_[0] = 0; diff --git a/Processors/68000/Implementation/68000Storage.hpp b/Processors/68000/Implementation/68000Storage.hpp index f7971960e..b1ada2f2f 100644 --- a/Processors/68000/Implementation/68000Storage.hpp +++ b/Processors/68000/Implementation/68000Storage.hpp @@ -284,6 +284,9 @@ class ProcessorStorage { BusStep *dbcc_condition_false_no_branch_steps_; BusStep *dbcc_condition_false_branch_steps_; + BusStep *movem_reads_steps_; + BusStep *movem_writes_steps_; + // Current bus step pointer, and outer program pointer. Program *active_program_ = nullptr; MicroOp *active_micro_op_ = nullptr; @@ -298,7 +301,7 @@ class ProcessorStorage { void set_is_supervisor(bool); // Transient storage for MOVEM. - uint32_t movem_addresses_[16]; + uint32_t movem_addresses_[33]; RegisterPair32 movem_spare_value_; /*!