KKTB: PSW shall not be altered during an RTI
This commit is contained in:
parent
7d5bec2197
commit
a571609304
1 changed files with 4 additions and 9 deletions
13
cpu.cpp
13
cpu.cpp
|
@ -238,15 +238,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)
|
||||||
psw |= v & 0174000; // current & previous mode can only be increased, 11 can only be set
|
psw = (v & 0174037) | (psw & 0174340);
|
||||||
|
else
|
||||||
psw &= 0174000; // retain upper 5 bit
|
psw = v & 0174377;
|
||||||
psw |= v & ~0174000;
|
|
||||||
}
|
|
||||||
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