diff --git a/MC6809/MC6809.UnitTest/AndTests.cs b/MC6809/MC6809.UnitTest/AndTests.cs index e9cdfda..4c4bb87 100644 --- a/MC6809/MC6809.UnitTest/AndTests.cs +++ b/MC6809/MC6809.UnitTest/AndTests.cs @@ -12,13 +12,7 @@ namespace EightBit private readonly Board board = new Board(); private readonly MC6809 cpu; - public AndTests() - { - this.cpu = this.board.CPU; - - this.board.Poke(0, 0x84); - this.board.Poke(1, 0x13); - } + public AndTests() => this.cpu = this.board.CPU; [TestInitialize] public void Initialise() @@ -33,13 +27,30 @@ namespace EightBit [TestMethod] public void TestImmediate() { + this.board.Poke(0, 0x84); + this.board.Poke(1, 0x13); this.cpu.A = 0xfc; + this.cpu.Step(); + Assert.AreEqual(0x10, this.cpu.A); Assert.AreEqual(0, this.cpu.Zero); Assert.AreEqual(0, this.cpu.Overflow); Assert.AreEqual(0, this.cpu.Negative); Assert.AreEqual(2, this.cpu.Cycles); } + + [TestMethod] + public void TestANDCC() + { + this.board.Poke(0xb00, 0x1c); + this.board.Poke(0xb01, 0xaf); + this.cpu.CC = 0x79; + this.cpu.PC.Word = 0xb00; + + this.cpu.Step(); + + Assert.AreEqual(0x29, this.cpu.CC); + } } } \ No newline at end of file