RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OMF::OMF51Format Class Reference

Intel Relocatable Object Module for the Intel MCS-51. More...

#include <omf.h>

Inheritance diagram for OMF::OMF51Format:
OMF::OMFFormat Linker::InputFormat Linker::Format Linker::Format Linker::Image Linker::Image

Classes

class  DebugItemsRecord
 
class  ExternalDefinition
 
class  ExternalDefinitionsRecord
 
class  FixupRecord
 
class  Module
 
class  ModuleEndRecord
 
class  ModuleHeaderRecord
 
class  PublicSymbolsRecord
 
class  ScopeDefinitionRecord
 
class  SegmentDefinition
 
class  SegmentDefinitionsRecord
 
class  SegmentInfo
 
class  SymbolDefinition
 
class  SymbolInfo
 

Public Types

enum  record_type_t : uint8_t {
  ModuleHeader = OMF80Format::ModuleHeader , ModuleEnd = OMF80Format::ModuleEnd , Content = OMF80Format::Content , Fixups = 0x08 ,
  SegmentDefinitions = 0x0E , ScopeDefinition = 0x10 , DebugItems = 0x12 , PublicDefinitions = OMF80Format::PublicDefinitions ,
  ExternalDefinitions = OMF80Format::ExternalDefinitions , LibraryModuleLocations = OMF80Format::LibraryModuleLocations , LibraryModuleNames = OMF80Format::LibraryModuleNames , LibraryDictionary = OMF80Format::LibraryDictionary ,
  LibraryHeader = OMF80Format::LibraryHeader
}
 
enum  segment_type_t : uint8_t {
  SegmentCode = 0 , SegmentXData = 1 , SegmentData = 2 , SegmentIData = 3 ,
  SegmentBit = 4 , SegmentNone = 5
}
 
enum  alignment_t : uint8_t {
  AlignAbsolute = 0 , AlignUnit = 1 , AlignBitAddressable = 2 , AlignFitsPage = 3 ,
  AlignFitsBlock = 4 , AlignPage = 5
}
 
using Record = OMFFormat::Record<record_type_t, OMF51Format, Module>
 
using UnknownRecord = OMFFormat::UnknownRecord<record_type_t, OMF51Format, Module>
 
using EmptyRecord = OMFFormat::EmptyRecord<record_type_t, OMF51Format, Module>
 
using ContentRecord = OMFFormat::ContentRecord<record_type_t, OMF51Format, Module>
 
using LibraryHeaderRecord = OMFFormat::LibraryHeaderRecord<record_type_t, OMF51Format, Module>
 
using LibraryModuleNamesRecord = OMFFormat::LibraryModuleNamesRecord<record_type_t, OMF51Format, Module>
 
using LibraryModuleLocationsRecord = OMFFormat::LibraryModuleLocationsRecord<record_type_t, OMF51Format, Module>
 
using LibraryDictionaryRecord = OMFFormat::LibraryDictionaryRecord<record_type_t, OMF51Format, Module>
 
- Public Types inherited from OMF::OMFFormat
typedef uint16_t index_t
 An index referring to an element or definition in the file, typically stored as 1 or 2 bytes, used for OMF86 and OMF96.
 

Public Member Functions

std::shared_ptr< RecordReadRecord (Linker::Reader &rd)
 Parses and returns an instance of the next record.
 
void ReadFile (Linker::Reader &rd) override
 Loads file into memory.
 
offset_t WriteFile (Linker::Writer &wr) const override
 Stores data in memory to file.
 
void Dump (Dumper::Dumper &dump) const override
 Display file contents in a nice manner.
 
void GenerateModule (Linker::Module &module) const override
 Loads the information into a module object, a convenience method when there is a single module generated.
 
- Public Member Functions inherited from Linker::Format
 Format (offset_t file_offset=0)
 
virtual void Clear ()
 Resets all fields to their default values, deallocate memory.
 
offset_t ImageSize () const override
 Retrieves size of stored data.
 
offset_t WriteFile (Writer &wr, offset_t count, offset_t offset=0) const override
 Writes data of non-zero filled sections.
 
- Public Member Functions inherited from Linker::Image
virtual std::shared_ptr< const ActualImageAsImage () const
 Retrieves a randomly accessible image.
 
std::shared_ptr< ActualImageAsImage ()
 Retrieves a randomly accessible image.
 
- Public Member Functions inherited from Linker::InputFormat
virtual void SetupOptions (std::shared_ptr< OutputFormat > format)
 Initializes the reader for linking purposes.
 
virtual void ProduceModule (ModuleCollector &linker, Reader &rd, std::string file_name)
 Reads a file and loads the information into a module object.
 
virtual void ProduceModule (Module &module, Reader &rd)
 Reads a file and loads the information into a module object, a convenience method when there is a single module generated.
 
virtual void GenerateModule (ModuleCollector &linker, std::string file_name, bool is_library=false) const
 Loads the information into a module object.
 
virtual bool FormatProvidesSegmentation () const
 Whether the format enables multiple x86 segments.
 
virtual bool FormatRequiresDataStreamFix () const
 Whether the generated file might contain bugs that require fixing.
 
virtual bool FormatProvidesResources () const
 Whether the format supports resources.
 
virtual bool FormatProvidesLibraries () const
 Whether the format enables importing/exporting libraries.
 

Static Public Member Functions

static std::shared_ptr< OMF51FormatReadOMFFile (Linker::Reader &rd)
 Parses an OMF51 file.
 
static void DumpAddFields (const Record *record, Dumper::Dumper &dump, Dumper::Region &region, const OMF51Format *omf, const Module *mod, size_t record_index)
 
- Static Public Member Functions inherited from OMF::OMFFormat
static std::string ReadString (Linker::Reader &rd, size_t max_bytes=size_t(-1))
 Reads a string prefixed with a length byte.
 
static void WriteString (ChecksumWriter &wr, std::string text)
 Writes a string prefixed with a length byte.
 
static index_t ReadIndex (Linker::Reader &rd)
 Parses a 1 or 2 byte index value.
 
static void WriteIndex (ChecksumWriter &wr, index_t index)
 Produces a 1 or 2 byte index value.
 
static size_t IndexSize (index_t index)
 Determines if the index value requires 1 or 2 bytes to store.
 
static std::shared_ptr< OMFFormatReadOMFFile (Linker::Reader &rd)
 Attempts to parse an OMF file, whether OMF80, OMF86, OMF51 or OMF96.
 

Public Attributes

std::vector< std::shared_ptr< Record > > records
 The ordered collection of records contained in the file.
 
std::vector< Modulemodules
 List of modules appearing in an OMF file, typically only one for an object file.
 
- Public Attributes inherited from OMF::OMFFormat
offset_t file_size = 0
 Used to calculate record offsets when generating OMF file.
 
- Public Attributes inherited from Linker::Format
offset_t file_offset
 

Static Public Attributes

static const std::map< offset_t, std::string > RecordTypeNames
 
static constexpr uint8_t SegmentAbsolute = 0
 

Detailed Description

Intel Relocatable Object Module for the Intel MCS-51.

Member Enumeration Documentation

◆ alignment_t

Enumerator
AlignAbsolute 

Non-relocatable.

AlignUnit 

Byte or bit alignment for SegmentBit segments.

AlignBitAddressable 

Must be allocated within the bit addressable part of SegmentData.

AlignFitsPage 

Must fit a 256 byte page.

AlignFitsBlock 

Must fit a 256 byte block.

AlignPage 

Align to a 256 byte page boundary.

◆ segment_type_t

Enumerator
SegmentCode 

64 KiB read-only memory

SegmentXData 

64 KiB read-write memory

SegmentData 

256 B internal RAM that is accessible via direct addressing, first 128 B shared with SegmentIData

SegmentIData 

256 B internal RAM that is accessible via indirect addressing, first 128 B shared with SegmentData

SegmentBit 

256 bit address space, part of SegmentData

SegmentNone 

Not a segment, but a symbol with this segment type is treated as a value.

Member Function Documentation

◆ Dump()

void OMF51Format::Dump ( Dumper::Dumper & dump) const
overridevirtual

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ GenerateModule()

void OMF51Format::GenerateModule ( Linker::Module & module) const
overridevirtual

Loads the information into a module object, a convenience method when there is a single module generated.

Reimplemented from Linker::InputFormat.

◆ ReadFile()

void OMF51Format::ReadFile ( Linker::Reader & rd)
overridevirtual

Loads file into memory.

Implements Linker::Format.

◆ WriteFile()

offset_t OMF51Format::WriteFile ( Linker::Writer & wr) const
overridevirtual

Stores data in memory to file.

Implements Linker::Format.

Member Data Documentation

◆ RecordTypeNames

const std::map< offset_t, std::string > OMF51Format::RecordTypeNames
static
Initial value:
=
{
}

The documentation for this class was generated from the following files: