本文整理汇总了C#中Processor.NextStep方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.NextStep方法的具体用法?C# Processor.NextStep怎么用?C# Processor.NextStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Processor
的用法示例。
在下文中一共展示了Processor.NextStep方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Absolute_Mode_Accumulator_Has_Correct_Result
public void Absolute_Mode_Accumulator_Has_Correct_Result(byte operation, byte accumulatorInitialValue, byte valueToTest, byte expectedValue)
{
var processor = new Processor();
Assert.That(processor.Accumulator, Is.EqualTo(0x00));
processor.LoadProgram(0, new byte[] { 0xA9, accumulatorInitialValue, operation, 0x05, 0x00, valueToTest }, 0x00);
processor.NextStep();
processor.NextStep();
Assert.That(processor.Accumulator, Is.EqualTo(expectedValue));
}
示例2: AbsoluteY_Mode_Accumulator_Has_Correct_Result
public void AbsoluteY_Mode_Accumulator_Has_Correct_Result(byte operation, byte accumulatorInitialValue, byte valueToTest, bool addressWraps, byte expectedValue)
{
var processor = new Processor();
Assert.That(processor.Accumulator, Is.EqualTo(0x00));
processor.LoadProgram(0, addressWraps
? new byte[] { 0xA9, accumulatorInitialValue, 0x84, 0x07, operation, 0xff, 0xff, 0x09, valueToTest }
: new byte[] { 0xA9, accumulatorInitialValue, 0x84, 0x07, operation, 0x07, 0x00, 0x01, valueToTest }, 0x00);
processor.NextStep();
processor.NextStep();
processor.NextStep();
Assert.That(processor.Accumulator, Is.EqualTo(expectedValue));
}
示例3: ADC_Accumulator_Correct_When_Not_In_BDC_Mode
public void ADC_Accumulator_Correct_When_Not_In_BDC_Mode(byte accumlatorIntialValue, byte amountToAdd, bool CarryFlagSet, byte expectedValue)
{
var processor = new Processor();
Assert.That(processor.Accumulator, Is.EqualTo(0x00));
if (CarryFlagSet)
{
processor.LoadProgram(0, new byte[] { 0x38, 0xA9, accumlatorIntialValue, 0x69, amountToAdd }, 0x00);
processor.NextStep();
}
else
processor.LoadProgram(0, new byte[] { 0xA9, accumlatorIntialValue, 0x69, amountToAdd }, 0x00);
processor.NextStep();
Assert.That(processor.Accumulator, Is.EqualTo(accumlatorIntialValue));
processor.NextStep();
Assert.That(processor.Accumulator, Is.EqualTo(expectedValue));
}
示例4: Klaus_Dorman_Functional_Test
[TestCase(0xF0, 0x33b7)] // decimal add/subtract test *** WARNING - tests documented behavior only! *** only valid BCD operands are tested, N V Z flags are ignored iterates through all valid combinations of operands and carry input uses increments/decrements to predict result & carry flag
// ReSharper disable InconsistentNaming
public void Klaus_Dorman_Functional_Test(int accumulator, int programCounter)
// ReSharper restore InconsistentNaming
{
var processor = new Processor();
processor.LoadProgram(0x400, KdTestProgram, 0x400);
var numberOfCycles = 0;
while (true)
{
processor.NextStep();
numberOfCycles++;
if (processor.ProgramCounter == programCounter)
break;
if (numberOfCycles > 40037912)
Assert.Fail("Maximum Number of Cycles Exceeded");
}
Assert.That(processor.Accumulator, Is.EqualTo(accumulator));
// ReSharper disable FunctionNeverReturns
}
示例5: ADC_Overflow_Flag_Correct
public void ADC_Overflow_Flag_Correct(byte accumlatorIntialValue, byte amountToAdd, bool setCarryFlag, bool expectedValue)
{
var processor = new Processor();
Assert.That(processor.Accumulator, Is.EqualTo(0x00));
if (setCarryFlag)
{
processor.LoadProgram(0, new byte[] { 0x38, 0xA9, accumlatorIntialValue, 0x69, amountToAdd }, 0x00);
processor.NextStep();
}
else
processor.LoadProgram(0, new byte[] { 0xA9, accumlatorIntialValue, 0x69, amountToAdd }, 0x00);
processor.NextStep();
Assert.That(processor.Accumulator, Is.EqualTo(accumlatorIntialValue));
processor.NextStep();
Assert.That(processor.IsOverflow, Is.EqualTo(expectedValue));
}
示例6: ADC_Carry_Correct_When_In_BDC_Mode
public void ADC_Carry_Correct_When_In_BDC_Mode(byte accumlatorIntialValue, byte amountToAdd, bool setCarryFlag,
bool expectedValue)
{
var processor = new Processor();
Assert.That(processor.Accumulator, Is.EqualTo(0x00));
processor.LoadProgram(0, new byte[] { 0xF8, 0xA9, accumlatorIntialValue, 0x69, amountToAdd }, 0x00);
processor.NextStep();
processor.NextStep();
Assert.That(processor.Accumulator, Is.EqualTo(accumlatorIntialValue));
processor.NextStep();
Assert.That(processor.CarryFlag, Is.EqualTo(expectedValue));
}
示例7: ADC_Negative_Flag_Correct
public void ADC_Negative_Flag_Correct(byte accumlatorIntialValue, byte amountToAdd, bool expectedValue)
{
var processor = new Processor();
Assert.That(processor.Accumulator, Is.EqualTo(0x00));
processor.LoadProgram(0, new byte[] { 0xA9, accumlatorIntialValue, 0x69, amountToAdd }, 0x00);
processor.NextStep();
Assert.That(processor.Accumulator, Is.EqualTo(accumlatorIntialValue));
processor.NextStep();
Assert.That(processor.Sign, Is.EqualTo(expectedValue));
}
示例8: NumberOfCyclesRemaining_Correct_When_In_IndirectIndexed_And_Wrap
public void NumberOfCyclesRemaining_Correct_When_In_IndirectIndexed_And_Wrap(byte operation, int numberOfCyclesUsed)
{
var processor = new Processor();
processor.LoadProgram(0, new byte[] { 0x84, 0x04, 0x71, 0x05, 0x08, 0xFF, 0xFF, 0x03 }, 0x00);
processor.NextStep();
//Get the number of cycles after the register has been loaded, so we can isolate the operation under test
var startingNumberOfCycles = processor.NumberofCyclesLeft;
processor.NextStep();
Assert.That(processor.NumberofCyclesLeft, Is.EqualTo(startingNumberOfCycles - numberOfCyclesUsed));
}
示例9: CLV_Overflow_Flag_Cleared_Correctly
public void CLV_Overflow_Flag_Cleared_Correctly()
{
var processor = new Processor();
processor.LoadProgram(0, new byte[] { 0xB8 }, 0x00);
processor.NextStep();
Assert.That(processor.OverflowFlag, Is.EqualTo(false));
}
示例10: ASL_Zero_Set_Correctly
public void ASL_Zero_Set_Correctly(byte valueToShift, bool expectedValue)
{
var processor = new Processor();
Assert.That(processor.ProgramCounter, Is.EqualTo(0));
processor.LoadProgram(0, new byte[] { 0xA9, valueToShift, 0x0A }, 0x00);
processor.NextStep();
processor.NextStep();
Assert.That(processor.Zero, Is.EqualTo(expectedValue));
}
示例11: NumberOfCyclesRemaining_Correct_After_Operations_That_Do_Not_Wrap
public void NumberOfCyclesRemaining_Correct_After_Operations_That_Do_Not_Wrap(byte operation, int numberOfCyclesUsed)
{
var processor = new Processor();
var startingNumberOfCycles = processor.NumberofCyclesLeft;
processor.LoadProgram(0, new byte[] { operation, 0x02, 0x03 }, 0x00);
processor.NextStep();
Assert.That(processor.NumberofCyclesLeft, Is.EqualTo(startingNumberOfCycles - numberOfCyclesUsed));
}
示例12: DEC_Negative_Has_Correct_Value
public void DEC_Negative_Has_Correct_Value(byte initalMemoryValue, bool expectedResult)
{
var processor = new Processor();
processor.LoadProgram(0, new byte[] { 0xC6, 0x03, 0x00, initalMemoryValue }, 0x00);
processor.NextStep();
Assert.That(processor.NegativeFlag, Is.EqualTo(expectedResult));
}
示例13: DEX_Zero_Has_Correct_Value
public void DEX_Zero_Has_Correct_Value(byte initialXRegisterValue, bool expectedResult)
{
var processor = new Processor();
processor.LoadProgram(0, new byte[] { 0xA2, initialXRegisterValue, 0xCA }, 0x00);
processor.NextStep();
processor.NextStep();
Assert.That(processor.ZeroFlag, Is.EqualTo(expectedResult));
}
示例14: CPY_Negative_Flag_Set_When_Result_Is_Negative
public void CPY_Negative_Flag_Set_When_Result_Is_Negative(byte xValue, byte memoryValue, bool expectedResult)
{
var processor = new Processor();
processor.LoadProgram(0, new byte[] { 0xA0, xValue, 0xC0, memoryValue }, 0x00);
processor.NextStep();
processor.NextStep();
Assert.That(processor.NegativeFlag, Is.EqualTo(expectedResult));
}
示例15: DEC_Memory_Has_Correct_Value
public void DEC_Memory_Has_Correct_Value(byte initalMemoryValue, byte expectedMemoryValue)
{
var processor = new Processor();
processor.LoadProgram(0, new byte[] { 0xC6, 0x03, 0x00, initalMemoryValue }, 0x00);
processor.NextStep();
Assert.That(processor.Memory.ReadValue(0x03), Is.EqualTo(expectedMemoryValue));
}