本文整理汇总了C#中Processor.InterruptRequest方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.InterruptRequest方法的具体用法?C# Processor.InterruptRequest怎么用?C# Processor.InterruptRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Processor
的用法示例。
在下文中一共展示了Processor.InterruptRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Klaus_Dorman_Interrupt_Test
[TestCase(0x06ec)] // Disable Interrupt Tests
public void Klaus_Dorman_Interrupt_Test(int programCounter)
{
var previousInterruptWatchValue = 0;
//var previousInterruptDisableCleared = false;
var processor = new Processor();
processor.LoadProgram(0x400, InterruptProgram, 0x400);
var numberOfCycles = 0;
while (true)
{
var interruptWatch = processor.Memory.ReadValue(0xbffc);
//This is used to simulate the edge triggering of an NMI. If we didn't do this we would get stuck in a loop forever
if (interruptWatch != previousInterruptWatchValue)
{
previousInterruptWatchValue = interruptWatch;
if ((interruptWatch & 2) != 0)
processor.NonMaskableInterrupt();
}
if (!processor.DisableInterruptFlag && (interruptWatch & 1) != 0)
processor.InterruptRequest();
processor.NextStep();
numberOfCycles++;
if (processor.ProgramCounter == programCounter)
break;
if (numberOfCycles > 100000)
Assert.Fail("Maximum Number of Cycles Exceeded");
}
}