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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Appendix 2: Library File <strong>Format</strong><br />

The first record in the library is a header that looks like any other object module format record.<br />

Note: Libraries under MS-DOS are always multiples of 512-byte blocks.<br />

Library Header Record (n bytes)<br />

1 2 4 2 1 <br />

Type Record Length Dictionary Dictionary Size Flags Padding<br />

(F0H) (Page Size Minus 3) Offset in Blocks<br />

The first byte of the record identifies the record's type, and the next two bytes specify the number of bytes<br />

remaining in the record. Note that this word field is byte-swapped (that is, the low-order byte precedes the<br />

high-order byte). The record type for this library header is F0H (240 decimal).<br />

The Record Length field specifies the page size within the library. <strong>Module</strong>s in a library always start at the<br />

beginning of a page. Page size is determined by adding three to the value in the Record Length field (thus the<br />

header record always occupies exactly one page). Legal values for the page size are given by 2 to the n,<br />

where n is greater than or equal to 4 and less than or equal to 15.<br />

The four bytes immediately following the Record Length field are a byte-swapped long integer specifying the<br />

byte offset within the library of the first byte of the first block of the dictionary.<br />

The next two bytes are a byte-swapped word field that specifies the number of blocks in the dictionary.<br />

Note: the MS-DOS Library Manager cannot create a library whose dictionary would require more than 251<br />

512-byte pages.<br />

The next byte contains flags describing the library. The current flag definition is:<br />

0x01 = case sensitive (applies to both regular and extended dictionaries)<br />

All other values are reserved for future use and should be 0.<br />

The remaining bytes in the library header record are not significant. This record deviates from the typical <strong>OMF</strong><br />

record in that the last byte is not used as a checksum on the rest of the record.<br />

Immediately following the header is the first object module in the library. It, in turn, is succeeded by all other object<br />

modules in the library. Each module is in object module format (that is, it starts with a LHEADR record and ends<br />

with a MODEND record). Individual modules are aligned so as to begin at the beginning of a new page. If, as is<br />

commonly the case, a module does not occupy a number of bytes that is exactly a multiple of the page size, then<br />

its last block will be padded with as many null bytes as are required to fill it.<br />

Following the last object module in the library is a record that serves as a marker between the object modules and<br />

the dictionary. It also resembles an <strong>OMF</strong> record.<br />

Library End Record (marks end of objects and beginning of dictionary)<br />

1 2 <br />

Type (F1H) Record Length Padding<br />

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

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

Saved successfully!

Ooh no, something went wrong!