public void OverflowWhenSetFiresOverflowDidChange()
        {
            var receivedEvents = new System.Collections.Generic.Dictionary<int, ushort>();

            var registers = new Registers();
            registers.OverflowDidChange += receivedEvents.Add;
            registers.Overflow = 10;

            Assert.That(receivedEvents[0], Is.EqualTo(10));
        }
        public void ProgramCounterwhenSetFiresProgramCounterWillChange()
        {
            var receivedEvents = new System.Collections.Generic.Dictionary<int, ushort>();

            var registers = new Registers();
            registers.ProgramCounterWillChange += receivedEvents.Add;
            registers.ProgramCounter = 10;

            Assert.That(receivedEvents[0], Is.EqualTo(10));
        }
        public void WriteGeneralPursoseRegisterValueWhenCalledFiresRegisterDidChange()
        {
            var receivedEvents = new System.Collections.Generic.Dictionary<int, ushort>();

            var registers = new Registers();
            registers.RegisterDidChange += receivedEvents.Add;
            registers.WriteGeneralPursoseRegisterValue(0, 10);

            Assert.That(receivedEvents[0], Is.EqualTo(10));
        }
Beispiel #4
0
 protected Cpu()
 {
     this.registers = new Registers();
 }