public void TestBitToFlagBit6ToOverflow() { Cpu cpu = new Cpu(); cpu.ImpliedAddress = false; cpu.Fetched = 0x61; cpu.A = 0x62; Assert.Equal(0, InstructionSet.BIT(cpu)); Assert.False(cpu.GetFlag(Flags.Z)); Assert.False(cpu.GetFlag(Flags.N)); Assert.True(cpu.GetFlag(Flags.V)); Assert.Equal(0x62, cpu.A); }
public void TestBitToNegative() { Cpu cpu = new Cpu(); cpu.ImpliedAddress = false; cpu.Fetched = 0x81; cpu.A = 0x82; Assert.Equal(0, InstructionSet.BIT(cpu)); Assert.False(cpu.GetFlag(Flags.Z)); Assert.True(cpu.GetFlag(Flags.N)); Assert.False(cpu.GetFlag(Flags.V)); Assert.Equal(0x82, cpu.A); }
public void TestBitToZero() { Cpu cpu = new Cpu(); cpu.ImpliedAddress = false; cpu.Fetched = 0x01; cpu.A = 0x02; Assert.AreEqual(0, InstructionSet.BIT(cpu)); Assert.IsTrue(cpu.GetFlag(Flags.Z)); Assert.IsFalse(cpu.GetFlag(Flags.N)); Assert.IsFalse(cpu.GetFlag(Flags.V)); Assert.AreEqual(0x02, cpu.A); }