ASH flag fix for shift <= 15

This commit is contained in:
folkert van heusden 2023-03-24 08:48:18 +01:00
parent 3a43e55663
commit fe191c7483
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -630,12 +630,12 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
if (shift == 0) { if (shift == 0) {
setPSW_c(false); setPSW_c(false);
setPSW_v(SIGN(R, false) != SIGN(oldR, false)); setPSW_v(false);
} }
else if (shift <= 15) { else if (shift <= 15) {
R <<= shift; R <<= shift;
setPSW_c(R & 0x10000); setPSW_c(R & 0x10000);
setPSW_v((!!SIGN(oldR, false)) != (!!(R >> 15))); setPSW_v(SIGN(oldR, false) != SIGN(R, false));
} }
else if (shift < 32) { else if (shift < 32) {
setPSW_c((R << (shift - 16)) & 1); setPSW_c((R << (shift - 16)) & 1);
@ -2185,7 +2185,7 @@ void cpu::step_b()
DOLOG(warning, true, "UNHANDLED instruction %06o @ %06o", instr, temp_pc); DOLOG(warning, true, "UNHANDLED instruction %06o @ %06o", instr, temp_pc);
trap(010); // trap(010); floating point nog niet geimplementeerd
} }
catch(const int exception) { catch(const int exception) {
DOLOG(debug, true, "bus-trap during execution of command (%d)", exception); DOLOG(debug, true, "bus-trap during execution of command (%d)", exception);