From 52bdfbdaa138be0ec2a721d940a3bd74c50e55ec Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sat, 19 Mar 2022 22:09:19 +0100 Subject: [PATCH] ASHC fix (see ASH) --- cpu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpu.cpp b/cpu.cpp index 3bec841..444e4d1 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -495,7 +495,8 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr) case 3: { // ASHC uint32_t R0R1 = (getRegister(reg) << 16) | getRegister(reg + 1); - int16_t shift = getGAM(dst_mode, dst_reg, true, false); + uint16_t a = getGAMAddress(dst_mode, dst_reg, false, false); + int16_t shift = b->read(a, false); if (shift > 0) { R0R1 <<= (shift & 0b111111) - 1; @@ -503,7 +504,7 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr) R0R1 <<= 1; } else if (shift < 0) { - R0R1 >>= -(shift & 0b111111) - 1; + R0R1 >>= -((shift & 0b111111) - 1); setPSW_c(R0R1 & 1); R0R1 >>= 1; }