Пример #1
0
 public void Visit(CilSwitchInstruction instruction)
 {
     if (_options.ShowBytes)
     {
         _writer.Write(string.Format("/* {0:X2,-4} | ", instruction.opCode.Value));
         string value = string.Format("{0:X2}000000", (int)instruction.Value);
         _writer.Write(string.Format("{0,-16} */ ", value));
         _writer.Write(string.Format("{0,-10}", instruction.opCode));
         _writer.Write('(');
         for (int i = 0; i < instruction.Token; i++)
         {
             _writer.WriteLine();
             WriteIndentation();
             _writer.Write(string.Format("{0,12} {1,-4} | ", "/*", ""));
             value = string.Format("{0:X2}000000", instruction.Jumps[i]);
             _writer.Write(string.Format("{0,-16} */ ", value));
             _writer.Write(string.Format("{0,11}", ' '));
             _writer.Write(string.Format("IL_{0:x4}", (instruction.IlOffset + instruction.Size + instruction.Jumps[i])));
             if (i < instruction.Token - 1)
             {
                 _writer.Write(',');
             }
         }
         _writer.WriteLine(')');
         return;
     }
     _writer.Write(string.Format("{0,-10}", instruction.opCode));
     _writer.Write('(');
     for (int i = 0; i < instruction.Token; i++)
     {
         _writer.WriteLine();
         WriteIndentation();
         _writer.Write(string.Format("{0,-21}", ""));
         _writer.Write(string.Format("IL_{0:x4}", (instruction.IlOffset + instruction.Size + instruction.Jumps[i])));
         if (i < instruction.Token - 1)
         {
             _writer.Write(',');
         }
     }
     _writer.WriteLine(')');
 }
Пример #2
0
 public void Visit(CilSwitchInstruction instruction)
 {
     if (_options.ShowBytes)
     {
         _writer.Write(string.Format("/* {0:X2,-4} | ", instruction.opCode.Value));
         string value = string.Format("{0:X2}000000", (int)instruction.Value);
         _writer.Write(string.Format("{0,-16} */ ", value));
         _writer.Write(string.Format("{0,-10}", instruction.opCode));
         _writer.Write('(');
         for (int i = 0; i < instruction.Token; i++)
         {
             _writer.WriteLine();
             WriteIndentation();
             _writer.Write(string.Format("{0,12} {1,-4} | ", "/*", ""));
             value = string.Format("{0:X2}000000", instruction.Jumps[i]);
             _writer.Write(string.Format("{0,-16} */ ", value));
             _writer.Write(string.Format("{0,11}", ' '));
             _writer.Write(string.Format("IL_{0:x4}", (instruction.IlOffset + instruction.Size + instruction.Jumps[i])));
             if (i < instruction.Token - 1)
             {
                 _writer.Write(',');
             }
         }
         _writer.WriteLine(')');
         return;
     }
     _writer.Write(string.Format("{0,-10}", instruction.opCode));
     _writer.Write('(');
     for (int i = 0; i < instruction.Token; i++)
     {
         _writer.WriteLine();
         WriteIndentation();
         _writer.Write(string.Format("{0,-21}", ""));
         _writer.Write(string.Format("IL_{0:x4}", (instruction.IlOffset + instruction.Size + instruction.Jumps[i])));
         if (i < instruction.Token - 1)
         {
             _writer.Write(',');
         }
     }
     _writer.WriteLine(')');
 }