Add ANDCC test to MC6809 core

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2019-06-10 08:52:32 +01:00
parent e0188e44cd
commit 78f2151ca7

View File

@ -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);
}
}
}