Exemplo n.º 1
0
        public static Instruction Destination(this Instruction instuction, Register value)
        {
            instuction.MaskedOpCode = instuction.MaskedOpCode.SetDest(OpCodeFlag.Register);
            instuction.Parameters = instuction.Parameters.Length == 0
                                        ? new uint[] {value}
                                        : new[] {value, instuction.Parameters[0]};

            return instuction;
        }
Exemplo n.º 2
0
        public static Instruction Source(this Instruction instuction, Register value)
        {
            instuction.MaskedOpCode = instuction.MaskedOpCode.SetSource(OpCodeFlag.Register);
            instuction.Parameters = instuction.Parameters.Length == 0
                                        ? new uint[] {value}
                                        : new[] { instuction.Parameters[0], value };

            return instuction;
        }
Exemplo n.º 3
0
 private void Invoke(Action<Cpu, byte, uint, uint> instruction, Register destination, uint value)
 {
     instruction(_cpu, (byte) OpCodeFlag.Register | (byte) OpCodeFlag.Constant << 2, destination, value);
 }
Exemplo n.º 4
0
 private void Invoke(Action<Cpu, byte, uint, uint> instruction, Register destination, MemoryAddress source)
 {
     instruction(_cpu, (byte) OpCodeFlag.Register | (byte) OpCodeFlag.MemoryAddress << 2, destination, source);
 }
Exemplo n.º 5
0
 private void Invoke(Action<Cpu, byte, uint> instruction, Register destination)
 {
     instruction(_cpu, (byte)OpCodeFlag.Register | (byte)OpCodeFlag.Register << 2, destination);
 }