cannot replace the run-mode bits nor the set of registers

This commit is contained in:
folkert van heusden 2024-04-04 18:03:39 +02:00
parent 30a6c9229c
commit 2334daff16
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -277,10 +277,13 @@ int cpu::getPSW_spl() const
void cpu::setPSW(const uint16_t v, const bool limited)
{
if (limited)
psw = (v & 0174037) | (psw & 0174340);
else
if (limited) {
// cannot replace the run-mode bits nor the set of registers
psw = (psw & 177400) | (v & 0377);
}
else {
psw = v & 0174377; // mask off 'unused' bits (8-10)
}
}
void cpu::setPSW_flags_nzv(const uint16_t value, const word_mode_t word_mode)