git: 9front

Download patch

ref: e11f6ec8c0d158ad6f4d1e9672e0abba5807090f
parent: ac24bc6b8d6925527022ab1192e9ef8f444a6ad3
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Thu Oct 25 02:55:41 EDT 2012

realemu: fix REP prefix condition

--- a/sys/src/cmd/aux/realemu/xec.c
+++ b/sys/src/cmd/aux/realemu/xec.c
@@ -1067,7 +1067,7 @@
 {
 	if(rep == OREPNE)
 		return (*f & ZF) == 0;
-	return !rep || (*f & ZF) != 0;
+	return (*f & ZF) != 0;
 }
 
 static void
@@ -1098,7 +1098,7 @@
 		d->off += n;
 		d->off &= m;
 		c--;
-		if(repcond(f, i->rep))
+		if(!repcond(f, i->rep))
 			break;
 	}
 	aw(areg(cpu, i->alen, RDI), d->off);
@@ -1135,7 +1135,7 @@
 		d->off += n;
 		d->off &= m;
 		c--;
-		if(repcond(f, i->rep))
+		if(!repcond(f, i->rep))
 			break;
 	}
 	aw(areg(cpu, i->alen, RDI), d->off);
--