Skip to content

Commit

Permalink
Fix multiplication carry flag behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
TollyH committed Oct 23, 2023
1 parent f05f07c commit db194a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Processor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit db194a8

Please sign in to comment.