예제 #1
0
        public string EmitFlagGroup(IProcessorArchitecture arch, string caption, uint grfFlags)
        {
            StringWriter sw = new StringWriter();

            EmitFlagGroup(arch, caption, grfFlags, sw);
            return(sw.ToString());
        }
예제 #2
0
        public string EmitFlagGroup(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> grfFlags)
        {
            StringWriter sw = new StringWriter();

            EmitFlagGroup(arch, caption, grfFlags, sw);
            return(sw.ToString());
        }
예제 #3
0
        public string EmitRegisters(IProcessorArchitecture arch, string caption, HashSet <RegisterStorage> regs)
        {
            StringWriter sw = new StringWriter();

            EmitRegisters(arch, caption, regs, sw);
            return(sw.ToString());
        }
예제 #4
0
 private static void EmitRegistersCore(IProcessorArchitecture arch, HashSet <RegisterStorage> regs, TextWriter sb)
 {
     foreach (var reg in regs.Where(r => r != null).OrderBy(r => r.Name))
     {
         sb.Write(" ");
         sb.Write(reg.Name);
     }
 }
예제 #5
0
 public static void EmitRegisters(IProcessorArchitecture arch, string caption, uint grfFlags, HashSet <RegisterStorage> regs, TextWriter sb)
 {
     sb.Write(caption);
     if (grfFlags != 0)
     {
         sb.Write(" {0}", arch.GrfToString(grfFlags));
     }
     EmitRegistersCore(arch, regs, sb);
 }
예제 #6
0
 public void EmitFlagGroup(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> flagRegs, TextWriter sb)
 {
     sb.Write(caption);
     foreach (var freg in flagRegs
              .Select(f => arch.GetFlagGroup(f.Key, f.Value) !)
              .OrderBy(f => f.Name))
     {
         sb.Write(" {0}", freg.Name);
     }
 }
예제 #7
0
파일: BlockFlow.cs 프로젝트: smx-smx/reko
 /// <summary>
 /// Writes flow state that is true on exit from the basic block.
 /// </summary>
 /// <param name="arch"></param>
 /// <param name="writer"></param>
 public void WriteAfter(IProcessorArchitecture arch, TextWriter writer)
 {
     EmitRegisters(arch, "// DataOut:", DataOut, writer);
     writer.WriteLine();
     EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer);
     writer.WriteLine();
     EmitLocals("// LocalsOut:", writer);
     if (TerminatesProcess)
     {
         writer.WriteLine("// Terminates process");
     }
 }
예제 #8
0
        public static void EmitRegisters(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> grfFlags, IEnumerable <Storage> regs, TextWriter sb)
        {
            sb.Write(caption);
            var sGrf = string.Join(" ", grfFlags
                                   .Where(f => f.Value != 0)
                                   .Select(f => arch.GetFlagGroup(f.Key, f.Value) !)
                                   .OrderBy(f => f.Name));

            if (sGrf.Length > 0)
            {
                sb.Write(" {0}", sGrf);
            }
            EmitRegistersCore(regs, sb);
        }
예제 #9
0
파일: BlockFlow.cs 프로젝트: smx-smx/reko
 public override void Emit(IProcessorArchitecture arch, TextWriter writer)
 {
     EmitRegisters(arch, "// DataOut:", DataOut, writer);
     writer.WriteLine();
     EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer);
     writer.WriteLine();
     SymbolicIn.Emit(arch, "// SymbolicIn:", writer);
     writer.WriteLine();
     EmitLocals("// LocalsOut:", writer);
     if (TerminatesProcess)
     {
         writer.WriteLine("// Terminates process");
     }
 }
예제 #10
0
        public static void EmitRegisters(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> grfFlags, IDictionary <Storage, BitRange> regRanges, TextWriter sb)
        {
            sb.Write(caption);
            var sGrf = string.Join(" ", grfFlags
                                   .Where(f => f.Value != 0)
                                   .Select(f => arch.GetFlagGroup(f.Key, f.Value) !)
                                   .OrderBy(f => f.Name));

            if (sGrf.Length > 0)
            {
                sb.Write(" {0}", sGrf);
            }
            foreach (var de in regRanges.OrderBy(de => de.Key.Name))
            {
                sb.Write(" {0}:{1}", de.Key, de.Value);
            }
        }
예제 #11
0
 public void EmitFlagGroup(IProcessorArchitecture arch, string caption, uint grfFlags, TextWriter sb)
 {
     sb.Write(caption);
     sb.Write(" {0}", arch.GrfToString(grfFlags));
 }
예제 #12
0
 public static void EmitRegisters(IProcessorArchitecture arch, string caption, HashSet <RegisterStorage> regs, TextWriter sb)
 {
     sb.Write(caption);
     EmitRegistersCore(arch, regs, sb);
 }
예제 #13
0
 /// <summary>
 /// Displays the dataflow object as a human-readable stream of text.
 /// </summary>
 /// <param name="arch">current processor architecture (to interpret registers)</param>
 /// <param name="sb">stream into which the data is written</param>
 public abstract void Emit(IProcessorArchitecture arch, TextWriter sb);
예제 #14
0
파일: BlockFlow.cs 프로젝트: smx-smx/reko
 /// <summary>
 /// Writes flow state that is true on entry to the basic block.
 /// </summary>
 /// <param name="arch"></param>
 /// <param name="writer"></param>
 public void WriteBefore(IProcessorArchitecture arch, TextWriter writer)
 {
     SymbolicIn.Emit(arch, "// SymbolicIn:", writer);
     writer.WriteLine();
 }