mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-03-11 05:41:49 +00:00
Add ANDCC test to MC6809 core
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user