Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Z80Registers"/> class.
        /// </summary>
        /// <param name="initialState">The initial state.</param>
        public Z80Registers(Z80RegisterState initialState)
        {
            _initialState = initialState;
            _primaryGeneralPurposeRegisterSet          = new GeneralPurposeRegisterSet();
            _alternativeGeneralPurposeRegisterSet      = new GeneralPurposeRegisterSet();
            _primaryAccumulatorAndFlagsRegisterSet     = new AccumulatorAndFlagsRegisterSet(new Intel8080FlagsRegister());
            _alternativeAccumulatorAndFlagsRegisterSet = new AccumulatorAndFlagsRegisterSet(new Intel8080FlagsRegister());

            Reset();
        }
Beispiel #2
0
        private static IEnumerable <Action> GetAssertions(Z80RegisterState expected, Z80RegisterState observed)
        {
            yield return(() => observed.I.ShouldBe(expected.I));

            yield return(() => observed.R.ShouldBe(expected.R));

            yield return(() => observed.IX.ShouldBe(expected.IX));

            yield return(() => observed.IY.ShouldBe(expected.IY));

            yield return(() => observed.InterruptFlipFlop1.ShouldBe(expected.InterruptFlipFlop1));

            yield return(() => observed.InterruptFlipFlop2.ShouldBe(expected.InterruptFlipFlop2));

            yield return(() => observed.InterruptMode.ShouldBe(expected.InterruptMode));

            yield return(() => observed.ProgramCounter.ShouldBe(expected.ProgramCounter));

            yield return(() => observed.StackPointer.ShouldBe(expected.StackPointer));
        }
Beispiel #3
0
 public Z80RegisterTests()
 {
     _state   = GetRegisterState();
     _subject = new Z80Registers(_state);
 }