예제 #1
0
파일: LdcI4.cs 프로젝트: djlw78/cs2asm
 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());
     }
 }
예제 #2
0
        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");
        }
예제 #3
0
파일: ldci4s.cs 프로젝트: djlw78/cs2asm
 public override void Emit(MethodDefinition md, Instruction c, AssemblyWriter writer)
 {
     writer.Push(c.Operand.ToString());
 }