MFPS flags & extend sign

This commit is contained in:
folkert van heusden 2022-03-22 21:42:47 +01:00
parent 468983b0b5
commit 899af8e5d5

View file

@ -901,10 +901,15 @@ bool cpu::single_operand_instructions(const uint16_t instr)
if (word_mode) { // MFPS if (word_mode) { // MFPS
uint16_t temp = psw & 0xff; uint16_t temp = psw & 0xff;
setPSW_n(temp & 128);
setPSW_z(temp == 0); setPSW_z(temp == 0);
setPSW_v(false); setPSW_v(false);
if (temp & 128) {
setPSW_n(true);
temp |= 0xff00;
}
putGAM(dst_mode, dst_reg, word_mode, temp, false); putGAM(dst_mode, dst_reg, word_mode, temp, false);
} }
else { // SXT else { // SXT