private static IEnumerable <InstructionData> GenerateInstructionDataWithSource(ReverseSymbolTable symTable,
                                                                                       TextSegmentAccessor textSegment,
                                                                                       SourceDebugData dbgData)
        {
            var instructions = new List <InstructionData>();

            using (var reader = File.OpenText(dbgData.SourceFilePath))
            {
                int currPgrmCtr = textSegment.StartingSegmentAddress;
                foreach (DisassembledInstruction inst in textSegment.RawInstructions)
                {
                    IParameterStringifier stringifier = InstructionTextMap.GetParameterStringifier(inst.InstructionType);
                    string formattedInstruction       = stringifier.GetFormattedInstruction(currPgrmCtr, inst, symTable);
                    string originalSourceLine         = string.Empty;
                    int    lineNum = -1;
                    if (dbgData.IsSourceTextAssociatedWithAddress(currPgrmCtr))
                    {
                        lineNum            = dbgData.GetLineNumberAssociatedWithAddress(currPgrmCtr);
                        originalSourceLine = reader.ReadLineAt(lineNum);
                        originalSourceLine = originalSourceLine.Trim();
                    }
                    var srcLineInfo     = new SourceLineInformation(dbgData.SourceFilePath, lineNum, currPgrmCtr, originalSourceLine);
                    var instructionElem = new InstructionData(inst.InstructionWord, currPgrmCtr, formattedInstruction, srcLineInfo);
                    instructions.Add(instructionElem);
                    currPgrmCtr += sizeof(int);
                }

                return(instructions);
            }
        }
        private static IEnumerable <InstructionData> GenerateInstructionDataWithNoSource(ReverseSymbolTable symTable,
                                                                                         TextSegmentAccessor textSegment)
        {
            var instructions = new List <InstructionData>();
            int currPgrmCtr  = textSegment.StartingSegmentAddress;

            foreach (DisassembledInstruction inst in textSegment.RawInstructions)
            {
                IParameterStringifier stringifier = InstructionTextMap.GetParameterStringifier(inst.InstructionType);
                string formattedInstruction       = stringifier.GetFormattedInstruction(currPgrmCtr, inst, symTable);
                var    srcLineInfo     = new SourceLineInformation(string.Empty, -1, currPgrmCtr);
                var    instructionElem = new InstructionData(inst.InstructionWord, currPgrmCtr, formattedInstruction, srcLineInfo);
                instructions.Add(instructionElem);
                currPgrmCtr += sizeof(int);
            }

            return(instructions);
        }