1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Incorporates ASR tests, and fixes ASR (xxx).w.

... which was re-injecting the wrong bit to preserve sign.
This commit is contained in:
Thomas Harte
2019-06-25 18:44:31 -04:00
parent 1fbbf32cd2
commit e12e8fc616
2 changed files with 141 additions and 2 deletions
@@ -1568,7 +1568,7 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
case Operation::ASLm: {
const auto value = active_program_->destination->halves.low.full;
active_program_->destination->halves.low.full = value << 1;
active_program_->destination->halves.low.full = uint16_t(value << 1);
extend_flag_ = carry_flag_ = value & 0x8000;
set_neg_zero_overflow(active_program_->destination->halves.low.full, 0x8000);
} break;
@@ -1601,7 +1601,7 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
case Operation::ASRm: {
const auto value = active_program_->destination->halves.low.full;
active_program_->destination->halves.low.full = (value&0x80) | (value >> 1);
active_program_->destination->halves.low.full = (value&0x8000) | (value >> 1);
extend_flag_ = carry_flag_ = value & 1;
set_neg_zero_overflow(active_program_->destination->halves.low.full, 0x8000);
} break;