private void outx(bool IncHL) { OutPort(C.Value, HLM.Value); dec(B); if (IncHL) { HL.Inc(); } else { HL.Dec(); } // See http://www.z80.info/zip/z80-documented.pdf for weird flag behavior int k = L.Value + HLM.Value; if (k > 0xFF) { CF = true; HF = true; } VF = P((k & 0x07) ^ B.Value) != 0; }
private void inx(bool IncHL) { HLM.Value = InPort(C.Value); dec(B); NF = (HLM.Value & 0x80) != 0x00; if (IncHL) { HL.Inc(); } else { HL.Dec(); } // See http://www.z80.info/zip/z80-documented.pdf for weird flag behavior byte c = C.Value; if (IncHL) { c++; } else { c--; } int k = c + HLM.Value; if (k > 0xFF) { CF = true; HF = true; } VF = P((k & 0x07) ^ B.Value) != 0; }
private void cpi() { WZ.Inc(); cpx(); HL.Inc(); }
private void ldi() { ldx(); DE.Inc(); HL.Inc(); }