From db194a828849f2dc8c55f1cd5c8d74050621a2b5 Mon Sep 17 00:00:00 2001 From: TollyH Date: Mon, 23 Oct 2023 15:35:35 +0100 Subject: [PATCH] Fix multiplication carry flag behaviour --- Processor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Processor.cs b/Processor.cs index 189c745..e6d23b4 100644 --- a/Processor.cs +++ b/Processor.cs @@ -454,7 +454,7 @@ public bool Execute(bool runUntilHalt, Stream? stdoutOverride = null) Registers[(int)Register.rsf] &= ~(ulong)StatusFlags.Overflow; - if (result < initial) + if (result < initial && mathend != 0) { Registers[(int)Register.rsf] |= (ulong)StatusFlags.Carry; }