IRL file format

An IRL file is an indexed REL file. The index is used to improve linker performance.

A file offset in an IRL is three bytes long:

	DB	high	;(File offset >> 14 ) & 0x7F
	DB	middle	;(File offset >>  7 ) & 0x7F
	DB	low	;(File offset     1 ) & 0x7F

The IRL file consists of three sections:

IRL header

This is 128 bytes long. Only the first three bytes are used; these contain the file offset of the REL image (see below). The other bytes are set to zero.

	DB	h,m,0	;Offset to REL image. The "low" figure is always 0;
			;the REL image will be aligned to 128 bytes.
	DS	125	;Unused, set to 0

Note that bit 7 of the first byte is always zero. In an orthodox non-indexed REL file, bit 7 of the first byte will always be 1 (the first bit of the Module Name record).

Symbol table

The symbol table is at offset 80h in the file, and contains a number of variable-length symbol records. Each record is formed:

	DB	h,m,l	 ;Offset to the REL module containing the symbol,
			 ;from the start of the REL image. 
	DB	'SYMBOL' ;ASCII, 1-8 characters
	DB	0FEh	 ;End of string

The end of the table is marked by a zero-length symbol:

	DB	h,m,0	;Length of the REL image. Note that this does NOT 
			;give the offset of the "EOF" record in the REL image;
			;it gives the number of bytes in the REL image 
			;including those that pack it out to a multiple of 128
			;bytes in length.
	DB	0FEh	;End of string

After this record, the table is then packed out (LIB uses 1Ah as the packing character) to the next 128-byte boundary.

REL image

The REL image then follows. This is in standard REL format. To convert an IRL library to a REL library, just remove the header and symbol table.


Return to archive listing