Example #1
0
 private void Write(LocalVariablesSection lvs)
 {
     sb.AppendLine($"[Local variables]");
     for (int i = 0; i < lvs.Vars.Length; i++)
     {
         //sb.AppendLine($"var[{i}] = {lvs.Refs[i]?.ToString() ?? "0"}");
         sb.AppendLine($"var[{i}] = ${lvs.Vars[i]:x}");
     }
 }
Example #2
0
        private void WriteLocals(LocalVariablesSection locals)
        {
            sb.AppendLine("(local");
            if (locals != null)
            {
                for (int i = 0; i < locals.Vars.Length; i++)
                {
                    //var offset = locals.Refs[i]?.TargetOffset ?? 0;
                    //sb.Append($"    local{i} = ${offset:x4}" ).AppendLine();

                    sb.Append($"    local{i} = ${locals.Vars[i]:x4}").AppendLine();
                }
            }
            sb.AppendLine(")");
            sb.AppendLine();
        }