PSW bit masking for RTI/RTT
This commit is contained in:
parent
9bb0dc305c
commit
c749db63e8
1 changed files with 4 additions and 8 deletions
12
cpu.cpp
12
cpu.cpp
|
@ -316,14 +316,10 @@ int cpu::getPSW_spl() const
|
||||||
|
|
||||||
void cpu::setPSW(const uint16_t v, const bool limited)
|
void cpu::setPSW(const uint16_t v, const bool limited)
|
||||||
{
|
{
|
||||||
if (limited) {
|
if (limited)
|
||||||
// cannot replace the run-mode bits nor the set of registers
|
psw = (psw & 0174340) | (v & 037);
|
||||||
// psw = (psw & ~0340) | (v & 0174340);
|
else
|
||||||
psw = (psw & 0177400) | (v & 037777);
|
psw = v & 0174377; // mask off reserved bits
|
||||||
}
|
|
||||||
else {
|
|
||||||
psw = v;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu::setPSW_flags_nzv(const uint16_t value, const word_mode_t word_mode)
|
void cpu::setPSW_flags_nzv(const uint16_t value, const word_mode_t word_mode)
|
||||||
|
|
Loading…
Add table
Reference in a new issue