From 1605d1a9a74309a6c3669f841621491354abafa7 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Fri, 29 Mar 2024 11:26:04 +0100 Subject: [PATCH] fix for v-flag for ASH shifts of < 32 --- cpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu.cpp b/cpu.cpp index 1f01104..b8708f4 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -697,7 +697,7 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr) else if (shift < 32) { setPSW_c((R << (shift - 16)) & 1); R = 0; - setPSW_v(!!oldR); + setPSW_v(SIGN(oldR, wm_word) != SIGN(R, wm_word)); } else if (shift == 32) { R = -sign;