protected CrayInstruction DisassembleOctBytes(string octalBytes) { ushort[] words = ToUInt16s(OctalStringToBytes(octalBytes)).ToArray(); var mem = new Word16MemoryArea(LoadAddress, words); return(Disassemble(mem)); }
// This spams the CI builds [Test] public void MS1750Dis_Generate() { var rnd = new Random(0x3421); var words = Enumerable.Range(0, 200) .Select(_ => (ushort)rnd.Next()) .ToArray(); var mem = new Word16MemoryArea(LoadAddress, words); var dasm = new MilStd1750Disassembler(arch, mem.CreateBeReader(0)); foreach (var instr in dasm) { } }
private ImageSegment MakeSegment(uint uAddr, List <mem_t> mems) { var totalLength = mems.Sum(m => m.word.Length); var words = new ushort[totalLength]; int offset = 0; foreach (var mem in mems) { Array.Copy(mem.word, 0, words, offset, mem.word.Length); offset += mem.word.Length; } var wmem = new Word16MemoryArea(Address.Ptr32(uAddr), words); var seg = new ImageSegment($"seg{uAddr:X6}", wmem, AccessMode.ReadWriteExecute); return(seg); }
public void Dumper_Word16MemoryArea() { program = new Program(); var arch = new Mock <IProcessorArchitecture>(); arch.Setup(a => a.CreateImageReader( It.IsAny <MemoryArea>(), It.IsAny <Address>(), It.IsAny <long>())) .Returns( (MemoryArea m, Address a, long b) => m.CreateBeReader(a, b)); var mem = new Word16MemoryArea(Address.Ptr16(0x1000), new ushort[] { 0x0000, 0x0102, 0x0304, 0x0506, 0x0708, 0xFFFF, 0x4869, 0x4249, 0x0000, 0x0102, 0x0304, 0x0506, 0x0708, 0xFFFF, 0x4869, 0x4241 }); var dmp = new Dumper(program); var sw = new StringWriter(); dmp.DumpData( arch.Object, mem, mem.BaseAddress + 1, 0x0D, new TextFormatter(sw)); var sExp = #region Expected @"1001 0102 0304 0506 0708 FFFF 4869 4249 ..........HiBI 1008 0000 0102 0304 0506 0708 FFFF ............ "; #endregion AssertOutput(sExp, sw); }