public void ADC_A_rTest() { PrivateObject param0 = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(param0); target.A = 0x16; target.Set(Flag.Carry); target.B = 0x10; target.ADC_A_r(0); Assert.IsTrue(target.A == 0x27, "Error: ADD A r"); }
public void JP_cc_nnTest() { PrivateObject param0 = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(param0); target.Set(Flag.Carry); target.Memory[0x1520] = 0x03; target.Memory[0] = 0x20; target.Memory[1] = 0x15; target.JP_cc_nn(3); Assert.IsTrue(target.PC == 0x1520, "Error: JP cc, nn"); }
public void ADC_HLTest() { PrivateObject param0 = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(param0); target.Set16BitRegisters(0, 0x16); target.Set(Flag.Carry); target.Set16BitRegisters(2, 0x10); target.ADC_HL(0); Assert.IsTrue(target.Get16BitRegisters(2) == 0x27, "Error: ADC HL"); }
public void CCFTest() { PrivateObject param0 = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(param0); target.Set(Flag.Carry); target.CCF(); Assert.IsTrue((target.F & Flag.Carry) != Flag.Carry, "Error: CCF"); }
public void SBC_HLTest() { PrivateObject z = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(z); target.Set16BitRegisters(2, 0x9999); target.Set16BitRegisters(1, 0x1111); target.Set(Flag.Carry); target.SBC_HL(1); Assert.IsTrue(target.Get16BitRegisters(2) == 0x8887, "Error: SBC HL, ss"); }
public void SBC_A_rTest() { PrivateObject z = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(z); target.A = 0x16; target.Set(Flag.Carry); target.Set16BitRegisters(2, 0x5433); target.Memory[0x5433] = 0x05; target.SBC_A_r(6); Assert.IsTrue(target.A == 0x10, "Error: SBC A r"); }
public void SBC_A_nTest() { PrivateObject z = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(z); target.Memory[0x5000] = 0x05; target.A = 0x16; target.PC = 0x5000; target.Set(Flag.Carry); target.SBC_A_n(); Assert.IsTrue(target.A == 0x10, "Error: SBC A n"); }
public void RLATest() { PrivateObject z = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(z); target.Set(Flag.Carry); target.A = 118; target.RLA(); Assert.IsTrue((target.F & Flag.Carry) != Flag.Carry && target.A == 237, "Error: RLA"); }
public void RET_ccTest() { PrivateObject z = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(z); target.Set(Flag.Sign); target.PC = 0x3535; target.SP = 0x5000; target.Memory[0x5000] = 0xb5; target.Memory[0x5001] = 0x18; target.RET_cc(7); // RET M Assert.IsTrue(target.SP == 0x5002 && target.PC == 0x18b5, "Error: RET cc"); }