コード例 #1
0
ファイル: Z80Test.cs プロジェクト: jo215/ZXSpectrum
 public void OTDRTest()
 {
     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[0x0ffe] = 0x51;
     target.Memory[0x0fff] = 0xa9;
     target.Memory[0x1000] = 0x03;
     //  Simulate PC-=2 (repeat instruction)
     target.OTDR();
     target.OTDR();
     target.OTDR();
     Assert.IsTrue(target.Get16BitRegisters(2) == 0x0ffd
             && target.B == 0, "Error:OTDR");
 }