public void LoadAsm(string filename) { var asmParser = new FileParser(filename); asmParser.Parse(); var binaryReader = new BinaryFileReader(filename.Replace(".asm", ".bin")); AsmFileContentList.Clear(); asmParser.Instructions.ForEach(instr => AsmFileContentList.Add(instr.InstructionString)); Instructions = asmParser.Instructions; binaryReader.ReadAll(); BinaryFileContentList.Clear(); binaryReader.Instructions.ForEach(instr => BinaryFileContentList.Add(SignExtension16(instr))); for (int i = 0, y = 0; i < binaryReader.Instructions.Count; i++, y += 2) { MainMemory[(ushort)y] = binaryReader.Instructions[i]; } _asmLoaded = true; }