From acfae910328817bd84e2a7c748c398bc96042525 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 16 Jul 2020 00:49:33 +0200 Subject: [PATCH] UserspaceEmulator: Fix incorrect SALC behavior As @tzoz pointed out, SALC should set AL to 0xff when CF=1, not 0x01. Fixes #2819. --- DevTools/UserspaceEmulator/SoftCPU.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index 39dd220946..84a988ec95 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -1560,7 +1560,7 @@ void SoftCPU::SAHF(const X86::Instruction&) { TODO(); } void SoftCPU::SALC(const X86::Instruction&) { - set_al(cf() ? 0x01 : 0x00); + set_al(cf() ? 0xff : 0x00); if (m_secret_handshake_state < 2) ++m_secret_handshake_state;