public void OTIRTest() { PrivateObject z = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(z); target.C = 0x07; target.B = 0x03; target.Set16BitRegisters(2, 0x1000); target.Memory[0x1000] = 0x51; target.Memory[0x1001] = 0xa9; target.Memory[0x1002] = 0x03; // Simulate PC-=2 (repeat instruction) target.OTIR(); target.OTIR(); target.OTIR(); Assert.IsTrue(target.Get16BitRegisters(2) == 0x1003 && target.B == 0, "Error: OTIR"); }