1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-09 06:29:33 +00:00

It leads to a TODO, but implemented decoding and initial setup of STOPpages.

This commit is contained in:
Thomas Harte 2019-04-29 19:30:00 -04:00
parent 3da1b3bf9b
commit 16fb3b49a5
3 changed files with 21 additions and 0 deletions

View File

@ -58,6 +58,8 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
// } // }
} }
// TODO: obey is_stopped_.
// Perform the microcycle. // Perform the microcycle.
remaining_duration -= remaining_duration -=
active_step_->microcycle.length + active_step_->microcycle.length +
@ -1624,6 +1626,11 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
negative_flag_ = zero_result_ & 0x80000000; negative_flag_ = zero_result_ & 0x80000000;
break; break;
case Operation::STOP:
set_status(prefetch_queue_.halves.low.full);
is_stopped_ = true;
break;
/* /*
Development period debugging. Development period debugging.
*/ */

View File

@ -464,6 +464,8 @@ struct ProcessorStorageConstructor {
LINK, // Maps a register to a LINK. LINK, // Maps a register to a LINK.
UNLINK, // Maps a register to an UNLINK. UNLINK, // Maps a register to an UNLINK.
STOP, // Maps to a STOP.
}; };
using Operation = ProcessorStorage::Operation; using Operation = ProcessorStorage::Operation;
@ -706,6 +708,8 @@ struct ProcessorStorageConstructor {
{0xfff8, 0x4e50, Operation::LINK, Decoder::LINK}, // 4-111 (p215) {0xfff8, 0x4e50, Operation::LINK, Decoder::LINK}, // 4-111 (p215)
{0xfff8, 0x4e58, Operation::UNLINK, Decoder::UNLINK}, // 4-194 (p298) {0xfff8, 0x4e58, Operation::UNLINK, Decoder::UNLINK}, // 4-194 (p298)
{0xffff, 0x4e72, Operation::STOP, Decoder::STOP}, // 6-85 (p539)
}; };
std::vector<size_t> micro_op_pointers(65536, std::numeric_limits<size_t>::max()); std::vector<size_t> micro_op_pointers(65536, std::numeric_limits<size_t>::max());
@ -751,6 +755,12 @@ struct ProcessorStorageConstructor {
#define inc(n) increment_action(is_long_word_access, is_byte_access, n) #define inc(n) increment_action(is_long_word_access, is_byte_access, n)
switch(mapping.decoder) { switch(mapping.decoder) {
case Decoder::STOP: {
storage_.instructions[instruction].requires_supervisor = true;
op(Action::None, seq("n"));
op(Action::PerformOperation);
} break;
case Decoder::LINK: { case Decoder::LINK: {
storage_.instructions[instruction].set_source(storage_, An, ea_register); storage_.instructions[instruction].set_source(storage_, An, ea_register);
op(Action::PerformOperation, seq("np nW+ nw np", { ea(1), ea(1) })); op(Action::PerformOperation, seq("np nW+ nw np", { ea(1), ea(1) }));

View File

@ -23,6 +23,8 @@ class ProcessorStorage {
RegisterPair32 prefetch_queue_; // Each word will go into the low part of the word, then proceed upward. RegisterPair32 prefetch_queue_; // Each word will go into the low part of the word, then proceed upward.
bool is_stopped_ = false;
// Various status bits. // Various status bits.
int is_supervisor_; int is_supervisor_;
int interrupt_level_; int interrupt_level_;
@ -127,6 +129,8 @@ class ProcessorStorage {
EXTbtow, EXTwtol, EXTbtow, EXTwtol,
LINK, UNLINK, LINK, UNLINK,
STOP,
}; };
/*! /*!