public CPicCodeGenerator(String Filename) { ArrayList Init = new ArrayList(); m_Hexfile = new CHexFile(Filename); m_CurrentMemoryLocation = m_RecordMemoryMarker; Init.Add(0x0000); m_MachineRecord = new CMachineCodeRecord(m_RecordMemoryMarker, 00, Init); m_Hexfile.InsertHexRecord(m_MachineRecord); m_RecordMemoryMarker += (Int16)(1 * 2); m_CurrentMemoryLocation++; }
/// <summary> /// /// </summary> /// <param name="Instruction"></param> public void AddInstruction(Object Instruction) { if (m_Instructions == null) m_Instructions = new ArrayList(); if ((m_Instructions.Count * 2) == 0x10) { m_MachineRecord = new CMachineCodeRecord(m_RecordMemoryMarker, 00, m_Instructions); m_Hexfile.InsertHexRecord(m_MachineRecord); m_RecordMemoryMarker += (Int16)(m_Instructions.Count * 2); m_Instructions.Clear(); } m_CurrentMemoryLocation++; m_Instructions.Add(Instruction); }
/// <summary> /// /// </summary> public void GenerateHexFile() { // Write the rest of the array to file. if (m_Instructions.Count > 0) { m_MachineRecord = new CMachineCodeRecord(m_RecordMemoryMarker, 00, m_Instructions); m_Hexfile.InsertHexRecord(m_MachineRecord); } m_Hexfile.GenerateHexFile(); }
/// <summary> /// /// </summary> /// <param name="HexRecord"></param> public void InsertHexRecord(CMachineCodeRecord HexRecord) { if (m_HexRecords == null) m_HexRecords = new ArrayList(); m_HexRecords.Add(HexRecord); }