shithub: 8080

Download patch

ref: 6ca6987e90f6757a354c0be220a4bd6c9e47d64a
parent: 0d4a0e8b087756ce01fdfd7527409baff200281b
author: Alex Musolino <[email protected]>
date: Thu May 11 11:40:46 EDT 2023

fix bug in dcr instruction: always either set or clr zero flag

--- a/das.c
+++ b/das.c
@@ -690,9 +690,13 @@
 
 	if(--x == 0)
 		cpu->flg |= Fzero;
-	cpu->flg &= ~Fsign;
+	else
+		cpu->flg &= ~Fzero;
+
 	if((x&0x80) != 0)
 		cpu->flg |= Fsign;
+	else
+		cpu->flg &= ~Fsign;
 
 	if(insn->r1 == M)
 		memwrite(a, x);