1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-18 19:29:34 +00:00

Simplifies and fixes post-inc MOVE behaviour.

This commit is contained in:
Thomas Harte 2019-04-24 13:14:25 -04:00
parent 958d44a20d
commit 0bb6b498ce

View File

@ -2843,20 +2843,19 @@ struct ProcessorStorageConstructor {
// If any post-incrementing was involved, do the post increment(s). // If any post-incrementing was involved, do the post increment(s).
if(ea_mode == PostInc || destination_mode == PostInc) { if(ea_mode == PostInc || destination_mode == PostInc) {
if(ea_mode == destination_mode) { const int ea_inc = inc(ea_register);
const int ea_inc = inc(ea_mode); const int destination_inc = inc(destination_register);
const int destination_inc = inc(destination_mode);
if(ea_inc == destination_inc) { // If there are two increments, and both can be done simultaneously, do that.
op(ea_inc | MicroOp::SourceMask | MicroOp::DestinationMask); // Otherwise do one or two individually.
} else { if(ea_mode == destination_mode && ea_inc == destination_inc) {
op(ea_inc | MicroOp::SourceMask); op(ea_inc | MicroOp::SourceMask | MicroOp::DestinationMask);
op(destination_inc | MicroOp::DestinationMask);
}
} else { } else {
if(ea_mode == PostInc) { if(ea_mode == PostInc) {
op(inc(ea_mode) | MicroOp::SourceMask); op(ea_inc | MicroOp::SourceMask);
} else { }
op(inc(destination_mode) | MicroOp::DestinationMask); if(destination_mode == PostInc) {
op(destination_inc | MicroOp::DestinationMask);
} }
} }
} }