17.01.2015 Views

Relocatable Object Module Format (OMF) Specification

Relocatable Object Module Format (OMF) Specification

Relocatable Object Module Format (OMF) Specification

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Relocatable</strong> <strong>Object</strong> <strong>Module</strong> <strong>Format</strong><br />

The <strong>Object</strong> Record <strong>Format</strong><br />

Record <strong>Format</strong><br />

All object records conform to the following format:<br />

<br />

1 2 1<br />

Record Type Record Length Record Contents Checksum or 0<br />

The Record Type field is a 1-byte field containing the hexadecimal number that identifies the type of object record.<br />

The format is determined by the least significant bit of the Record type field. An odd Record Type indicates that<br />

certain numeric fields within the record contain 32-bit values; an even Record Type indicates that those fields<br />

contain 16-bit values. The affected fields are described with each record. Note that this principle does not govern<br />

the Use32/Use16 segment attribute (which is set in the ACBP byte of SEGDEF records); it simply specifies the<br />

size of certain numeric fields within the record. It is possible to use 16-bit <strong>OMF</strong> records to generate 32-bit<br />

segments, or vice versa.<br />

The Record Length field is a 2-byte field that gives the length of the remainder of the object record in bytes<br />

(excluding the bytes in the Record Type and Record Length fields). The record length is stored with the low-order<br />

byte first. An entire record occupies 3 bytes plus the number of bytes in the Record Length field.<br />

The Record Contents field varies in size and format, depending on the record type.<br />

The Checksum field is a 1-byte field that contains the negative sum (modulo 256) of all other bytes in the record.<br />

In other words, the checksum byte is calculated so that the low-order byte of the sum of all the bytes in the record,<br />

including the checksum byte, equals 0. Overflow is ignored. Some compilers write a 0 byte rather than computing<br />

the checksum, so either form should be accepted by programs that process object modules.<br />

Note: The maximum size of the entire record (unless otherwise noted for specific record types) is<br />

1024 bytes.<br />

Tool Interface Standards (TIS) <strong>OMF</strong> <strong>Specification</strong>, Version 1.1 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!