From 64dd360cc9c32658fb8fa386303cf3276b014ae3 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Fri, 29 Mar 2024 15:13:53 +0100 Subject: [PATCH] ASRB (re?-)fix --- cpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu.cpp b/cpu.cpp index 397ef36..b0a292c 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -1190,7 +1190,7 @@ bool cpu::single_operand_instructions(const uint16_t instr) setPSW_c(v & 1); if (word_mode == wm_byte) - v = (v & 255) >> 1; + v = ((v & 255) >> 1) | (v & 0xff00); else v >>= 1; v |= hb; @@ -1210,7 +1210,7 @@ bool cpu::single_operand_instructions(const uint16_t instr) setPSW_c(v & 1); if (word_mode == wm_byte) - v = (v & 255) >> 1; + v = ((v & 255) >> 1) | (v & 0xff00); else v >>= 1; v |= hb;