Exemplo n.º 1
0
 private MachineInstruction RunTest(params ushort [] words)
 {
     var bytes = new byte[words.Length * 2];
     LeImageWriter writer = new LeImageWriter(bytes);
     foreach (ushort word in words)
     {
         writer.WriteLeUInt16(word);
     }
     var image = new LoadedImage(Address.Ptr16(0x200), bytes);
     var rdr = new LeImageReader(image, 0);
     var arch = new Pdp11Architecture();
     var dasm = new Pdp11Disassembler(rdr, arch);
     return dasm.First();
 }
Exemplo n.º 2
0
 protected MachineInstruction Disassemble16(params ushort[] instrs)
 {
     var image = new MemoryArea(Address.Ptr32(0x00100000), new byte[4]);
     LeImageWriter w = new LeImageWriter(image.Bytes);
     foreach (var instr in instrs)
     {
         w.WriteLeUInt16(instr);
     }
     var arch = CreateArchitecture();
     var dasm = CreateDisassembler(arch, image.CreateLeReader(0));
     Assert.IsTrue(dasm.MoveNext());
     var armInstr = dasm.Current;
     dasm.Dispose();
     return armInstr;
 }
Exemplo n.º 3
0
 private byte[] CreateMsdosHeader()
 {
     ImageWriter stm = new LeImageWriter(new byte[16]);
     stm.WriteByte(0x4D);    // MZ
     stm.WriteByte(0x5A);
     stm.WriteBytes(0xCC, 4);
     stm.WriteLeUInt16(0x0090);
     stm.WriteBytes(0xCC, 0x12);
     stm.WriteByte(0x00);
     stm.WriteByte(0x00);
     stm.WriteByte(0x05);
     stm.WriteByte(0x21);
     stm.WriteString("PKLITE", Encoding.ASCII);
     stm.WriteBytes(0xCC, 0x0C);
     return stm.Bytes;
 }