public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { ab.Pop("eax"); //value a ab.Pop("ebx"); //value b ab.Or("eax", "ebx"); ab.Push("eax"); }
public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { ab.Pop("eax"); //value a ab.Pop("ebx"); //value b ab.Imul("ebx"); // imul ecx, eax, ebx; result in ecx ab.Push("EAX"); }
public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { ab.Pop("eax"); //value a ab.Pop("ebx"); //value b ab.Cmp("eax", "ebx"); ab.Jl(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_1CLT"); ab.Push("1"); ab.Jmp(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_0CLT"); ab.Label(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_1CLT"); ab.Push("0"); ab.Label(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_0CLT"); }
public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { if (md.ReturnType.ToString() != typeof(void).ToString()) { ab.Pop("eax"); } ab.Pop("edi"); ab.Pop("esi"); ab.Mov("esp", "ebp"); ab.Pop("ebp"); ab.Line(); ab.Ret(); }
public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { if (!char.IsDigit(i.OpCode.Name.Split('.').Last()[0])) { //pop eax //mov dword[esp + 4], eax ab.Pop("eax"); ab.Mov("dword[ebp - " + (4 * (Convert.ToInt32(i.Operand.ToString().Split('_').Last()) + 1)) + "]", "eax"); } else { //pop eax //mov dword[esp + 4], eax ab.Pop("eax"); ab.Mov("dword[ebp - " + (4 * (Convert.ToInt32(i.OpCode.Name.Split('.').Last()) + 1)) + "]", "eax"); } }
public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { ab.Pop("ebx"); //addres ab.Mov("al", "byte[ebx]"); ab.Push("eax"); }
public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { ab.Pop("eax"); //flag ab.Cmp("eax", "1"); ab.Jmpe(Utils.SafeName(md.FullName) + i.Operand.ToString().Split(':')[0]); }
public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md) { ab.Pop("eax"); ab.Mov("dword [" + Utils.SafeName(i.Operand.ToString()) + "]", "eax"); }