ASH carry flag

This commit is contained in:
Folkert van Heusden 2025-04-04 22:29:53 +02:00
parent dd546c34d7
commit a965b9ce7e
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -832,13 +832,16 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
setPSW_v(false);
}
else if (shift < 32) {
setPSW_c((R << (shift - 16)) & 1);
if (shift > 15)
setPSW_c((R << (shift - 16)) & 1);
setPSW_v(false);
for(int i=0; i<shift; i++) {
R <<= 1;
if (SIGN(R, wm_word) != sign)
setPSW_v(true);
}
if (shift <= 15)
setPSW_c(R & 0x10000);
}
else if (shift == 32) {
R = -sign;
@ -857,10 +860,8 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
}
}
R &= 0xffff;
setPSW_n(SIGN(R, wm_word));
setPSW_z(R == 0);
setPSW_z((R & 0xffff) == 0);
set_register(reg, R);