Exemple #1
0
        public override string ToString()
        {
            var result = new StringBuilder();

            TvcBasicRows.ForEach(s => result.AppendLine(s.RowText));
            return(result.ToString());
        }
Exemple #2
0
        private void GenerateBasicRow(string rowText)
        {
            if (m_CurrentBasicRowNumber > MaxTvcBasicLineNumber)
            {
                throw new TvcBasicException($" A basic sorok száma túllépte a megengedett maximális({MaxTvcBasicLineNumber}) értéket!");
            }

            TvcBasicRows.Add(new TvcBasicRow($"{m_CurrentBasicRowNumber:D}" + rowText));

            m_CurrentBasicRowNumber += m_LineNumberDifference;
        }
Exemple #3
0
        /// <summary>
        /// Generates the basic loader for the assembled program.
        /// A 'TvcBasicException' is thrown if the generating process is failed!
        /// </summary>
        public bool GenerateBasicLoader()
        {
            try
            {
                GenerateBasicDataRows();
                foreach (ProgramSection programSection in m_AssembledProgram.ProgramSections)
                {
                    GenerateBasicRow($"FORI={programSection.ProgramStartAddress:D}TO{programSection.ProgramStartAddress + (programSection.SectionLength - 1):D}:READB:POKE I,B:NEXTI");
                }
                if (m_SubRoutineStartAddress > 0)
                {
                    GenerateBasicRow($"S=USR({m_SubRoutineStartAddress:D})");
                }

                TvcBasicRows.ForEach(bsRow => BasicLoaderProgramBytes.AddRange(bsRow.TokenizedBytes));
                BasicLoaderProgramBytes.Add(0x00); //The TVC basic program must be closed with zero byte
            }
            catch (TvcBasicException exception)
            {
                m_StatusMessage.AppendLine(exception.Message);
                return(false);
            }
            return(true);
        }