public override void Emit(MethodDefinition md, Instruction c, AssemblyWriter writer) { if (c.Operand != null) { writer.Push(c.Operand.ToString()); } else { writer.Push(c.OpCode.Name.Split('.').Last()); } }
public override void Emit(MethodDefinition md, Instruction c, AssemblyWriter writer) { int num = 0; if (c.OpCode == OpCodes.Ldloc) { num = (int)c.Operand; } else { num = int.Parse(c.OpCode.Name.Split('.').Last()); } var offset = md.Body.Variables.Count * 4; writer.Mov("eax", $"[ebp-{offset}]"); writer.Push("eax"); }
public override void Emit(MethodDefinition md, Instruction c, AssemblyWriter writer) { writer.Push(c.Operand.ToString()); }