private static void TestIndex(PrefixCbOpCode op, OpCode expected, bool gameboy = true) { using (var fixture = new DecodeFixture(4, 15, PrimaryOpCode.Prefix_CB, op).ThrowOn8080().OnGameboy(gameboy)) { fixture.Expected.OpCode(expected).Operands(Operand.mHL); } }
private static void TestZ80Index(PrefixCbOpCode op, Operand index, OpCode expected) { var displacement = Rng.SByte(); using (var fixture = new DecodeFixture(6, 23, index.GetZ80IndexPrefix(), PrimaryOpCode.Prefix_CB, displacement, op).ThrowUnlessZ80()) { fixture.Expected.OpCode(expected).Operands(index).Displacement(displacement); } }
public void SET_n_r(PrefixCbOpCode op, byte bit, Operand r) => Test(op, bit, r, OpCode.BitSet);
public void RES_n_r(PrefixCbOpCode op, byte bit, Operand r) => Test(op, bit, r, OpCode.BitReset);
public void BIT_n_r(PrefixCbOpCode op, byte bit, Operand r) => Test(op, bit, r, OpCode.BitTest, 3, 12);
public void RR_r_mIXYd(PrefixCbOpCode op, Operand r, Operand index) => TestZ80AutocopyIndex(op, index, r, index, OpCode.RotateRight);
public void RR_r(PrefixCbOpCode op, Operand r) => TestCb(op, r, OpCode.RotateRight);
public void RRC_r(PrefixCbOpCode op, Operand r) => TestCb(op, r, OpCode.RotateRightWithCarry);
public void SLS_r(PrefixCbOpCode op, Operand r) => TestCb(op, r, OpCode.ShiftLeftSet, false);
public void RLC_r_mIXYd(PrefixCbOpCode op, Operand r, Operand index) => TestZ80AutocopyIndex(op, index, r, index, OpCode.RotateLeftWithCarry);
public void SRL_r_mIXYd(PrefixCbOpCode op, Operand r, Operand index) => TestZ80AutocopyIndex(op, index, r, index, OpCode.ShiftRightLogical);
public void SRL_r(PrefixCbOpCode op, Operand r) => TestCb(op, r, OpCode.ShiftRightLogical);
public void SRA_r(PrefixCbOpCode op, Operand r) => TestCb(op, r, OpCode.ShiftRight);
public void SLS_r_mIXYd(PrefixCbOpCode op, Operand r, Operand index) => TestZ80AutocopyIndex(op, index, r, index, OpCode.ShiftLeftSet);
public void BIT_n_IXYd(Operand index, PrefixCbOpCode op, byte bit, Operand r) => Z80IndexTest(index, op, bit, r, OpCode.BitTest, 5, 20, false);
public void RL_r(PrefixCbOpCode op, Operand r) => TestCb(op, r, OpCode.RotateLeft);
public void SET_n_IXYd(Operand index, PrefixCbOpCode op, byte bit, Operand r) => Z80IndexTest(index, op, bit, r, OpCode.BitSet);
public void SLA_r(PrefixCbOpCode op, Operand r) => TestCb(op, r, OpCode.ShiftLeft);