public void TestAndToNegative() { Cpu cpu = new Cpu(); cpu.ImpliedAddress = false; cpu.Fetched = 0x82; cpu.A = 0x81; Assert.Equal(1, InstructionSet.AND(cpu)); Assert.False(cpu.GetFlag(Flags.Z)); Assert.True(cpu.GetFlag(Flags.N)); Assert.Equal(0x80, cpu.A); }
public void TestAndToZero() { Cpu cpu = new Cpu(); cpu.ImpliedAddress = false; cpu.Fetched = 0x01; cpu.A = 0x02; Assert.AreEqual(1, InstructionSet.AND(cpu)); Assert.IsTrue(cpu.GetFlag(Flags.Z)); Assert.IsFalse(cpu.GetFlag(Flags.N)); Assert.AreEqual(0x00, cpu.A); }