git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5334
4a8a32a2-be11-0410-ad9d-
d568d2c75423
2009-01-05 Philipp Klaus Krause <pkk AT spth.de>
2009-01-05 Philipp Klaus Krause <pkk AT spth.de>
- * /device/lib/z80/mod.s,
+ * sim/ucsim/z80.src/inst_ed.cc:
+ Fixed bug #2488074, which made regression tests fail.
+
+2009-01-05 Philipp Klaus Krause <pkk AT spth.de>
+
+ * device/lib/z80/mod.s,
device/lib/z80/div.s,
device/lib/z80/mulchar.s,
device/lib/z80/mul.s,
device/lib/z80/div.s,
device/lib/z80/mulchar.s,
device/lib/z80/mul.s,
return(resGO);
case 0xB1: // CPIR
return(resGO);
case 0xB1: // CPIR
-/* fixme: checkme, compare to other emul. */
// compare acc with mem(HL), if ACC=0 set Z flag. Incr HL, decr BC.
// compare acc with mem(HL), if ACC=0 set Z flag. Incr HL, decr BC.
- regs.F &= ~(BIT_ALL); /* clear these */
- regs.F |= BIT_N | BIT_P;
+ regs.F &= ~(BIT_P | BIT_A | BIT_Z | BIT_S); /* clear these */
+ regs.F |= BIT_N;
- if ((regs.A - get1(regs.HL)) == 0) {
- regs.F |= (BIT_Z | BIT_P);
- return(resGO);
- }
+ if((regs.A - get1(regs.HL)) == 0)
+ regs.F |= BIT_Z;
+ else
+ regs.F &= ~BIT_Z;
+ if((regs.A - get1(regs.HL)) & 0x80)
+ regs.F |= BIT_S;
+ else
+ regs.F &= ~BIT_S;
+/* fixme: set BIT_A correctly. */
- } while (regs.BC != 0);
+ } while (regs.BC != 0 && (regs.F & BIT_Z) == 0);
+ if(regs.BC != 0)
+ regs.F |= BIT_P;