Write() 공개 메소드

Writes an instruction to the output stream.
public Write ( X86Instruction instruction ) : void
instruction X86Instruction The instruction to write.
리턴 void
예제 #1
0
        public override void Write(WritingContext context)
        {
            var assembler = new X86Assembler(context.Writer);

            foreach (var instruction in Instructions)
            {
                assembler.Write(instruction);
            }
        }
예제 #2
0
 public DataSegment CreateRawMethodBody()
 {
     using (var stream = new MemoryStream())
     {
         var writer    = new BinaryStreamWriter(stream);
         var assembler = new X86Assembler(writer);
         foreach (var instruction in Instructions)
         {
             assembler.Write(instruction);
         }
         return(new DataSegment(stream.ToArray()));
     }
 }
예제 #3
0
        private static void TestAssembler(IReadOnlyList<X86Instruction> instructions)
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "test.bin");
            using (var stream = File.Create(path))
            {
                var writer = new BinaryStreamWriter(stream);
                var assembler = new X86Assembler(writer);

                foreach (var instruction in instructions)
                    assembler.Write(instruction);
            }

            ValidateCode(instructions, File.ReadAllBytes(path));
        }
예제 #4
0
 public override void Write(WritingContext context)
 {
     var assembler = new X86Assembler(context.Writer);
     foreach (var instruction in Instructions)
         assembler.Write(instruction);
 }