/// <summary> /// Gets the memory. /// </summary> /// <param name="operand">The operand.</param> /// <param name="emit">if set to <c>true</c> [emit].</param> /// <returns></returns> private Memory GetMemory(Operand operand) { Memory address = null; if (operand is FieldOperand) { address = this.GetAddress(operand as FieldOperand); } else if (operand is Argument) { address = this.GetAddress(operand as Argument); } else if (operand is Local) { address = this.GetAddress(operand as Local); } else if (operand is IR.Operands.Register) { address = this.GetAddress(operand as IR.Operands.Register); } else { throw new NotImplementedEngineException("Wrong '" + operand.ToString() + "' Operand."); } if (operand.InternalType == InternalType.I1 || operand.InternalType == InternalType.U1) { address = new ByteMemory(address); } else if (operand.InternalType == InternalType.I2 || operand.InternalType == InternalType.U2) { address = new WordMemory(address); } else if (operand.InternalType == InternalType.I4 || operand.InternalType == InternalType.U4 || operand.InternalType == InternalType.I || operand.InternalType == InternalType.U || operand.InternalType == InternalType.ValueType || operand.InternalType == InternalType.O || operand.InternalType == InternalType.M || operand.InternalType == InternalType.SZArray || operand.InternalType == InternalType.Array) { address = new DWordMemory(address); } else if (operand.InternalType == InternalType.I8 || operand.InternalType == InternalType.U8) { address = new DWordMemory(address); } else { throw new NotImplementedEngineException("'" + operand.InternalType + "' not supported."); } return(address); }
/// <summary> /// MUL mem8 /// </summary> public static void MUL (ByteMemory target) { }
/// <summary> /// MOVZX reg32,mem8 /// </summary> public static void MOVZX (R32Type target, ByteMemory source) { }
/// <summary> /// MOVSX reg16,mem8 /// </summary> public static void MOVSX (R16Type target, ByteMemory source) { }
/// <summary> /// MOVZX reg32,mem8 /// </summary> public void MOVZX (R32Type target, ByteMemory source) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "MOVZX", target.ToString () + ", " + source.ToString (), source, null, target, null, new string [] { "o32", "0F", "B6", "/r" })); }
/// <summary> /// SUB reg8,mem8 /// </summary> public static void SUB (R8Type target, ByteMemory source) { }
/// <summary> /// SHR mem8,imm8 /// </summary> public static void SHR (ByteMemory target, Byte source) { }
/// <summary> /// SETZ mem8 /// </summary> public static void SETZ (ByteMemory target) { }
/// <summary> /// ADC reg8,mem8 /// </summary> public void ADC (R8Type target, ByteMemory source) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "ADC", target.ToString () + ", " + source.ToString (), source, null, target, null, new string [] { "12", "/r" })); }
/// <summary> /// XOR mem8,imm8 /// </summary> public void XOR (ByteMemory target, Byte source) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "XOR", target.ToString () + ", " + string.Format ("0x{0:x}", source), target, null, null, new UInt32 [] { source }, new string [] { "80", "/6", "ib" })); }
/// <summary> /// XOR mem8,reg8 /// </summary> public void XOR (ByteMemory target, R8Type source) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "XOR", target.ToString () + ", " + source.ToString (), target, null, source, null, new string [] { "30", "/r" })); }
/// <summary> /// SHR mem8,imm8 /// </summary> public void SHR (ByteMemory target, Byte source) { if (source == 1) this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "SHR__1", target.ToString () + ", " + "1", target, null, null, null, new string [] { "D0", "/5" })); else { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "SHR", target.ToString () + ", " + string.Format ("0x{0:x}", source), target, null, null, new UInt32 [] { source }, new string [] { "C0", "/5", "ib" })); } }
/// <summary> /// SHR mem8,CL /// </summary> public void SHR__CL (ByteMemory target) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "SHR__CL", target.ToString () + ", " + "CL", target, null, null, null, new string [] { "D2", "/5" })); }
/// <summary> /// SETZ mem8 /// </summary> public void SETZ (ByteMemory target) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "SETZ", target.ToString (), target, null, null, null, new string [] { "0F", "94", "/0" })); }
/// <summary> /// NOT mem8 /// </summary> public void NOT (ByteMemory target) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "NOT", target.ToString (), target, null, null, null, new string [] { "F6", "/2" })); }
/// <summary> /// NOT mem8 /// </summary> public static void NOT (ByteMemory target) { }
/// <summary> /// ROL mem8,CL /// </summary> public static void ROL__CL (ByteMemory target) { }
/// <summary> /// TEST mem8,imm8 /// </summary> public static void TEST (ByteMemory target, Byte source) { }
/// <summary> /// SHR mem8,CL /// </summary> public static void SHR__CL (ByteMemory target) { }
/// <summary> /// CMPXCHG mem8,reg8 /// </summary> public static void CMPXCHG (ByteMemory target, R8Type source) { }
/// <summary> /// SUB mem8,reg8 /// </summary> public static void SUB (ByteMemory target, R8Type source) { }
/// <summary> /// IDIV mem8 /// </summary> public static void IDIV (ByteMemory target) { }
/// <summary> /// INC mem8 /// </summary> public static void INC (ByteMemory target) { }
/// <summary> /// INC mem8 /// </summary> public void INC (ByteMemory target) { this.instructions.Add (new Instruction (true, string.Empty, string.Empty, "INC", target.ToString (), target, null, null, null, new string [] { "FE", "/0" })); }