mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 07:30:21 +00:00
Implements MOVEA as distinct from MOVE.
At least as far as MOVE is implemented, that is.
This commit is contained in:
parent
87420881c8
commit
c9c16968bb
@ -85,6 +85,10 @@ template <class T, bool dtack_is_implicit> void Processor<T, dtack_is_implicit>:
|
||||
active_program_->destination->halves.low.halves.low = uint8_t(result);
|
||||
} break;
|
||||
|
||||
/*
|
||||
MOVE.b, MOVE.l and MOVE.w: move the least significant byte or word, or the entire long word,
|
||||
and set negative, zero, overflow and carry as appropriate.
|
||||
*/
|
||||
case Operation::MOVEb:
|
||||
zero_flag_ = active_program_->destination->halves.low.halves.low = active_program_->source->halves.low.halves.low;
|
||||
negative_flag_ = zero_flag_ & 0x80;
|
||||
@ -103,6 +107,21 @@ template <class T, bool dtack_is_implicit> void Processor<T, dtack_is_implicit>:
|
||||
overflow_flag_ = carry_flag_ = 0;
|
||||
break;
|
||||
|
||||
/*
|
||||
MOVEA.l: move the entire long word;
|
||||
MOVEA.w: move the least significant word and sign extend it.
|
||||
Neither sets any flags.
|
||||
*/
|
||||
|
||||
case Operation::MOVEAw:
|
||||
active_program_->destination->halves.low.full = active_program_->source->halves.low.full;
|
||||
active_program_->destination->halves.high.full = (active_program_->destination->halves.low.full & 0x8000) ? 0xffff : 0;
|
||||
break;
|
||||
|
||||
case Operation::MOVEAl:
|
||||
active_program_->destination->full = active_program_->source->full;
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cerr << "Should do something with program operation " << int(active_program_->operation) << std::endl;
|
||||
break;
|
||||
|
@ -264,6 +264,7 @@ struct ProcessorStorageConstructor {
|
||||
for(size_t instruction = 0; instruction < 65536; ++instruction) {
|
||||
for(const auto &mapping: mappings) {
|
||||
if((instruction & mapping.mask) == mapping.value) {
|
||||
auto operation = mapping.operation;
|
||||
const auto micro_op_start = storage_.all_micro_ops_.size();
|
||||
|
||||
switch(mapping.decoder) {
|
||||
@ -367,18 +368,15 @@ struct ProcessorStorageConstructor {
|
||||
// Source = Dn or An
|
||||
//
|
||||
|
||||
case 0x0001: // MOVEA Dn, An
|
||||
case 0x0101: // MOVEA An, An
|
||||
operation = Operation::MOVEAw; // Substitute MOVEA for MOVE.
|
||||
case 0x0000: // MOVE Dn, Dn
|
||||
case 0x0100: // MOVE An, Dn
|
||||
op(Action::PerformOperation, seq("np"));
|
||||
op();
|
||||
break;
|
||||
|
||||
case 0x0001: // MOVEA Dn, An
|
||||
case 0x0101: // MOVEA An, An
|
||||
op(Action::PerformOperation, seq("np"));
|
||||
op(int(Action::SignExtendWord) | MicroOp::DestinationMask);
|
||||
break;
|
||||
|
||||
case 0x0002: // MOVE Dn, (An)
|
||||
case 0x0102: // MOVE An, (An)
|
||||
case 0x0003: // MOVE Dn, (An)+
|
||||
@ -640,7 +638,7 @@ struct ProcessorStorageConstructor {
|
||||
}
|
||||
|
||||
// Install the operation and make a note of where micro-ops begin.
|
||||
storage_.instructions[instruction].operation = mapping.operation;
|
||||
storage_.instructions[instruction].operation = operation;
|
||||
micro_op_pointers[instruction] = micro_op_start;
|
||||
|
||||
// Don't search further through the list of possibilities.
|
||||
|
@ -43,7 +43,8 @@ class ProcessorStorage {
|
||||
ABCD, SBCD,
|
||||
ADD, AND, EOR, OR, SUB,
|
||||
|
||||
MOVEb, MOVEw, MOVEl
|
||||
MOVEb, MOVEw, MOVEl,
|
||||
MOVEAw, MOVEAl
|
||||
};
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user