8086 RELOCATABLE OBJECT MODULE FORMATS An Intel Technical Specification Order Number: 121748-001 .
Additional copies of this manual or other Intel literature may be obtained from: Literature Department Intel Corporation 3065 Bowers A venue Santa Clara, CA 95051 The information in this document is subject to change without notice. Intel Corporation makes no warranty of any kind with regard to this material. including, but not limited to. the implied warranties of merchantability and fitness for a particular purpose.
8086 Object Module Formats Version 4." TABLE OF CONTENTS DOCUMENT CONTROL • • .......
8086 Object Module Formats Version 4.(J LIBRARY DICTIONARY RECORD COMMENT RECORD • • • • • • • ·· .. .. •• •• ·· .. .. . . .. .. .. • 85 • Sf; APPENDICES 1. 2. 3. 4. 4 NUMERIC LIST OF RECORD TYPES TYPE REPRES ENTA'tIONS • • • SYNTAX DIAGRA~S • • • • • • EXAMPLES OF FIXUPS • • ·· .. .. ·· .. .. .. ... • • ........• ·.
Sf) 86 Object i\4odule Formats Version 4.rrJ INTRODUC'f ION Here are the object record formats that define the object lanquaqe for the 8686 microprocessor. The 8086 object lanquaqe is the output of all lanquaqe translators with the 8086 as the tarqet processor. 'fhe 8086 -object lanquaqe is input and output for object languaqe processors such as linkers, locaters, librarians, and debuqgers. The 8086 object module formats permit specification of relocatable memory imaqes that may be linked to one another.
8086 Object Module Formats symbols. This restriction is enforced by it. Version 4.
8086 Object Module Formats Version 4.8 In the PIC/LTL case, an LSEG is not allowed to be in more than one group (e.g. defininq two qroups such as Gr GI(A,C,B) and Gr G2(B,C,D) in the same module is not legal). Otherwise an LSEG may be in more than one group. The existence of qroups such as Gl and G2 is not sufficient to infer that A,B,C,D all lie within some single FRAME, althouqh they miqht.
086 Object Module Formats Version 4.0 NAME - The ~complete name H of an LSEG is defined to be the three component identification consistinq of the Segment Name, Class Name and Overlay Name. LSEG's from different modules will be combined iff their Com~lete Names are identical.
Version 4.9 8086 Object Module Formats MODULE IDENTIFICATION In order to determin~ that a file contains an object program, a module header record will always be the first record in a module. There are three kinds of header records and each provides a module name. The additional functions of the header records are explained below. A module name may be qenerated durinq one of two processes: translation or linking. A module that results from translation is called a T-MODULE.
808fi Object Module Formats Version 4.0 represents contiquous reqions of memory whose contents are determined at translation-time. These reqions are called LOGICAL SEGMENTS (LSEG's). A module must contain information that defines the attributes of each LSEG. The SEG~ENT DEFINITION RECORD (SEGDEF) is the vehicle by which all LSEG information (name, length, memory alignment, etc.) is maintained.
Version 4.0 8086 Object Module Formats The requirements for symbol definition records for module linkinq is satisfied by the PUBLIC NAMES DEFINITION RECORD (PUBDEF), the EXTERNAL NAMES DEFINITION RECORD (EXTDEF), and the TYPE DEFINITION RECORD (TYPDEF). Their semantics will be explained later.
8086 Object Module Formats Version 4.~ absolute or relocatable, are found in LOGICAL DATA RECORDS. The ENUMERATED and ITERATED attributes within the classes are two ways of representinq the actual data bytes. A 8086 loader can load RDATA or PDATA Records, but will probably not be able to maintain the LSEG table information reauired for loadinq LDATA Records.
808~ Version 4.0 Object Module Formats CONCEPTUAL FRAMEWORK for FIXUP's A "Fixup" is some modification to object code, requested by a translator, performed by the R&L system, achievinq address bindinq. (see Appendix 4 for Examples) (Note) This definition of "fixup- accurately represents the viewpoint maintained by the R&L system. Nevertheless. the R&L system can be used to achieve modifications of object code (i.e., dfixups") that do not conform to this definition. For example.
8086 Object Module Formats version 4.0 pointer is present or not): (2) an OFFSET is merely the low order word of a pointer (and R&L doesn't care if the high order word follows or not); (3) a HIBYTE is merely the hiqh order half of an OFFSET (and R&L doesn't Nare if the low order half precedes or not); (4) a LOBYTE is merely the low order half of an OFFSET (and R&L doesn't care if the hiQh order half follows or not).
R986 Object Module Formats Version 4.9 (T6) X is an EXTERNAL INDEX. The TARGET is the byte whose address is (eventually qiven by) the External Name identified by the INDEX. (T7) X is a FRAME NUMBER. address is (X*l6).
808~ Object Module Formats Version 4.0 displacement between the LOCATION and the TARGET must be within 32K. To indicate this type of fixup, a 7th way (F6) of specifyinq a frame is introduced. Below is the frames: descriptlon of (Fe) x is a SEGMENT INDEX. the LSEG defined by the INDEX. the seven ways of specifying The FRAME is the canonic FRAME of (FI) X is a GROUP INDEX. The FRA~E is the canonic FRAME defined by the group (i.
8886 Object Module Formats Verslon 4.8 (FSd) The TARGET is specified with an explicit FRAME NUMBER: in this case the FRAME is determined as in (F3) above. (F6) No X. There is no FRAME. This is a way to indicate to R&L that an 8089 self-relative reference is to be processed. A siqned displacement between the LOCATION 20-bit address and the TARGET 20-bit address must be computed.
8086 Object Module Formats Version 4.0 If the LOCATION is a BASE. POINTER. or HIBYTE. it is unclear what the translator had in mind, and the action taken by R&L is defined by LINK-86 and/or LOCATE-86 EPS·s. SEGMENT-RELATIVE FIXUPS A seqment-relative fixup operates in the followinq way: a nonneqative l~-bit number, FBVAL, is defined as the FRAME NUMBER of the FRAME specified by the fixup, and a signed 20-bit number, FOVAL, is defined as the distance from the base of the FRAME to the TARGET.
808~ Object <---- in +------+ +n +------+ q Formats OATA Record +------+------+ +n or +-~----+------+ q or Version 4.9 ----> <--- or +------+ +------+ q +------+ ~odule +-------+ ...------+ in FIXUP Record +------+----~~+ +n ---> <--- Case 1 <--- Case <--- 2 Case 3 +------+ Case 1 illustrates the situation where a fixup is specified in "secondary" way.
8086 Object Module Formats Version 4.0 (1) A 5 HORT-JMP is being made to an external subroutine. In this case, the TARGET should be specified as TARGET: EI(subroutine) ,0000H The reason is that when LINK-86 learns where the subroutine is located, it will probably be a known offset (dl) within some LSEG A. Thus, LINK-8~ will convert the above TARGET to the form: .
8086 Object Module Formats version 4.9 ~he followinq example (3) is a case where access verification works whether the TARGET specification is ~primary~ or ·secondary-: (3) The translator wishes to reference ·forwards~ from a REFERENT, and to ensure that the TARGET lies within the specified FRAME. For example, we wish to reference the l00'th byte in an external structure STRCT. The translator may specify the fixup as FRAME: SI(FOO) TARGET: EI(STRCT) ,99 R&L will ensure that the distance.
8086 Object Module Formats Version 4.0 RECORD ORDER A object code file must contain a seauence of (one or more) modules, or a library containing zero or more modules. A module is defined as a collection of object code defined by a sequence of object records. The followinq syntax shows the valid orderinqs of records to form a module. In addition, the qiven semantic rules provide information about how to interpret the record sequence.
808~ Object Module Formats mod tail = libtail = LIBNAM LIBLOC LIBDIC. Version 4.9 [REGINT1 MODEND. NOTE: The character strinqs represented by capital letters above are not literals but are identifiers that are further defined in the section defininq the Record Formats. The following rules apply: 1. A FIXUPP record always refers to the previous DATA record. 2. The debug records have as their originatinq module named by the nearest precedinq THEADR record. 3.
8086 Object Module Formats Version 4.0 !~~B~P~~TION.to. the. RECORD The followinq paqes present diaqrams sample, to schematic form. Here is a conventions: FO~MATS of Record illustrate Formats in the various SAMPLE, RECORD --.. ---- . FORMAT (SAMREC) ...-.
8086 Object Module Formats Version 4.0 Any field that indicates a ~NAMEd has the followinq internal structure: the 1st byte contains a number between 0 and 40, inclusive, that indicates the number of remaininq bytes in the field. The remaininq bytes are interpreted as a byte string1 each byte must represent the Ascii code of a character drawn from this set: { ?(rl:. 0l2345f;789ABCDEFGHIJKLMNOPQRSTUVWXYZ }.
8986 Object Module Formats version 4.0 T-MODULE HEADER RECORD (THEAi5R) ***********************///*********** * * * REC TYP * 80H * * * * * * RECORD LENG'fH * * * * * * T MODULE NAME * * * * CHK SUI" * * * * * ***********************///*********** Every module output from a translator must have aT-MODULE HEADER RECORD.
Version 4.0 8086 Object Module Formats HEADER RECORD (LHEADR) Lr~ODULE, ***********************///*********** * * * * 82H * * REC * * TYP * * RECORD LENGTH * * L-MODULE * * * NAME ** * * * * * * CHK * SU~ * ***********************///*********** Every module previously created by (cross) LINK-86 (Vl.3 or earlier) or by LOCATE-8~ may have an L-MODULE HEADER RECORD. This record serves only to identify a module that has been processed (output) by LINK-86/LOCATE-86.
8~8~ Object Module Formats "er~ ion 4., ~ HEADER RECORD (RHEADR) R-~ODULE ***********************///*********///*********///*********** * * * * * * * * * * REC TYP * * * * * RECORD LENG'fH 6EH * * * * R-MODULE NAME R-MODULE ATTR * * R-MOOULE INFO * * CHK * * SUI., * * * * * * * * * * ***********************///*********///*********///*********** Every module created by LINK-8~/LOCATE-8~ may have an R-MODULg HEADER RECORD.
8086 Object Module Formats Version 4.0 TYP is a 2-bit su~field that specifies the module type. semantics are defined as follows: TYP=0 TYP=l TYP=2 TYP=3 The The module is an absolute module. The module is a relocatable module. Fixups other than base fixups may still be present. The module is a Position Independent Code module. It can be loaded anywhere. No fixups are needed. The module is a Load-Time Locatable Module. It can be loaded anywhere with perhaps some base fixups to be performed.
8086 Object Module Formats Version 4.0 DYNAMIC STORAGE is the memory space that must be allocated (for buffer, for dynamic expansion, etc ••• ) at load-time. The d&faUl· value is zero. MAXIMUM DYNAMIC STORAGE is the maximum dynamic memory that miqht be needed by the module. This .
Version 4.0 8086 Object Module Formats LIST OF· NAMES. RECORD ------ (LNAMEST-' -"-' ... ***********************///*********** * * * * * * * * REC TYP 9~H * * * RECORD LENGTH * * NAME * * * * CHK SUM * * * * * * * * ***********************///*********** I 1 +----rpt----+ This Record provides a list of Names that may be used in followinq SEGDEF and GRPDEF Records as the names of Seqments, Classes, Overlays and/or Groups.
808~ Object Module formats SEG~ENT Version 4.0 DEFINITION.
version 4.0 d086 Object Module Formats attribute of the LSEG. A=0 A=l A=2 A=3 A=4 A=5 A=6 The semantics are defined as follows: SEGDEF describes an absolute LSEG. SEGDEF describes a relocatable, byte aliqned LSEG. SEGDEF describes a relocatable, word aliqned LSEG. SEGDEF describes a relocatable, paraqraph aligned LSEG. SEGDEF describes a relocatable, paqe aligned LSEG. SEGDEF describes an unnamed absolute portion of MAS.
8086 Object Module Formats Version 4.0 P (Paqe-Resident) is a l-bit subfield which, if 1, demands that the seqment be located in ~AS without crossinq a page boundary. ·(This corresponds to the Min-paqe- relocation type of 8080 R&L.) The FRAME NUMBER and OFFSET fields (present only for absolute seqments, A-9 or A-5) specify the placement in MAS of the absolute segment. The range of OFFSET i$ constrained to be between 0 and 15 inclusive.
8086 Object Module Formats Version 4.8 attribute bit in the ACBP field (see above) must be used to give the segment a length of 64K. SEGMENT NAME -------. INDEX The Segment Name is a name the programmer or translator assigns to the segment. Examples: CODE, DATA, TAXDATA, MODULENAME CODE, STACK. This field provides the Segment Name, by indexing into the l;st of names provided by the LNAMES Record(s). CLASS NAME INDEX The Class Name is a name the proqrammer or translator can assign to a segment.
8086 Object Module Formats Version 4.0 GROUP DEFINITiON RECORD .......--..-..-- (GRPDEF) ***********************///**********///************ * * * * * * * * * * REC TYP 9AH * * * * RECORD LENGTH * * * * GROUP NAME INDEX * * * * GROUP COMPONENT DESCRIPTOR * * * * CHK SUM * * * * ***********************///**********///************ I I +--repeated---+ GROUP NAME INDEX The Group Name is a name by which a collection of 1 or more LSEG's may be referenced.
8186 Object Module Formats Version 4.
8086 Object Module Formats Version 4.0 A Name Index with value zero carries special siqnificance: it specifies all ~ames. (Note: Name Indices with zero value may not occur in other record types.) If the first byte of the DESCRIPTOR contains 0FBH. then the DESCRIPTOR contains 3 more fields. which are the LTL OAT field. the maximum length of the qroup, and the lenqth of the qroup. This descriptor, if present. must· precede all other descriptors in the record.
80B6 Object Module Formats names Version 4.0 (Examples) Assume that an LNAMES record exists such that the "DATA", I' RAM MYPROG" , "CODE", .. " (null), "STACK-" "CONST" 'I , It and "MEMORY" are selected by Name Index values of 1, 2, 3, 4, 5, 7 and 8, respectively • .
8086 Object Module Formats Version 4.
8086 Object Module Formats Version 4." The EN field is a byte: the 8 bits, left to riqht, indicate if the following 8 Leaves (left to riqht) are Easy (bit=0) or Nice (bit=l) • The LEAF DESCRIPTOR field.
8086 Object Module Formats Version 4.0 ******* * * * * * 133 * * * * * ******* ************* * * * * * * *-127 134 * to *+127 * * * * * * ************* ******************* * * * -32K * * * to * 135 * * +32K * * * * * * ******************* **************************.*** * * * 4-byte signed * * * integer * 136 * * * * * * * * ****************************** The sinqle byte, containinq a value between 0 anti 128 reoresents a Numeric Leaf or a Null Leaf. If the value is 128.
8086 Object Module Formats 'fhe sixth Repeat Leaf can last leaf of considered to considered to leaves. Version 4.8 form, ~ sinqle byte of 133, is a Repeat Leaf. A only occur as the last leaf of a Branch. If the a branch is a Repeat Leaf then the previous leaf is repeat indefinitely. Otherwise the 'Branch is end in an indefinitely lonq sequence of easy Null The seventh form, with a leading byte containing 134, represents a Siqned Numeric Leaf.
8086 Object Module Formats Version 4.
8086 Object Module Formats Version 4.0 (Informal Discussion) The FRAME NUMBER is present iff both the SEGMENT INDEX and GROUP INDEX are zero. A non-zero GROUP INDEX selects some qroup1 this group is taken as the -frame of reference- for references to all public symbols defined in this record, e.q., LINK-86 and LOCATE-86 will perform the following actions: (1) Any fixup of the form: TARGET: El (P) FRAME: TARGET (where .
808~ Object Module Formats Version 4.0 TYPE INDEX The TYPE INDEX field identifies a sinqle precedinq TYPDEF (Type Definition) Record containinq a descriptor for the typ~ of entity represented by the Public Symbol.
version 4.0 898n Object Module Formats EXT~RNAL... !AMES DEFINITION RECORD (EXTDEF) ***********************///*********///*********** * * * * * * * REC * * TYP * RECORD LENGTH * * EXTERNAL NAME * * TYPE INDEX * * C~K SUM * * * * 8CH * * * * * * * * * * ***********************///*********///*********** , , +-------repeated--------+ This Record provides a list of external names, an~ for each such name, the type of object it represents.
8086 Object Module Formats T~il·E. INDEX This field identifies a Definition) Record containinq named by the External Symbol. 48 Version 4.
8086 Object Module Formats Version 4.0 LOCAL SY~BOLS.
808~ Object Module Formats Version 4.0 of the LSEG specified by the SEGMENT INDEX. (There must be no FRAME NUMBER field in this case.) If both the GROUP INDEX field and the SEGMENT INDEX field contain zero, then the next field is a FRAME NU~BER: in this case, the referent value is the location of the first byte of the specified frame.
808~ Version 4.
8986 Ob·ject Module Formats Version 4.0 ICE-86 to -GO TO LINE NUMBER 22 OF MODULE MODNAME M • ICE-8~ may respond by executinq a lonq jump to the appropriate location. This long jump will set the CS register; it is important that the CS register be set in accordance with the assumptions made while translating the code. This is the purpose of the GROUP INDEX field. LINE NUMBER ------ A line number between Band 32767, inclusive, is provided in binary by this field.
8086 Object Module Formats Version 4.
808~ Version 4.0 Object Module Formats SLOCK INFOR~ATIO~ The BLOCK INFORMATION block has the followinq format: *****///***************************** * * * * BLOCK BLOCK * * * * LENG'rH * OFFSET * NAME * * * * * * * * * * *****///***************************** NAME This field contains the name of the block. describes an unnamed block in the source code (e.q. no label in PL/M) the NAME will be of lenqth 0. If the record a DO block with OFFSET -BLOCK ...-._---.....
8086 Object I~dule Formats Version 4.0 PROCEDURE INFORMATION The PROCEDURE INFOR~ATION block has the followinq format: ************************************************** * , I I I I I I * * I I I I I I I * *PILI010101010IB* * , I I , , I I * * , I I I , I I * * RETURN ADDRESS OFFSET * * * * ************************************************** +----------conditional-----------+ The P (Procedure) bit, if 1, indicates that the BLKDEF record was generated from a procedure in the source.
8986 Object Module Formats Version 4." BLOCK ENn RECORD (BLKEND) ************************* * * * * * * * * REC TYP 7CH * * * * RECORD LENGTH * * * * CHK SUM * * * * ************************* This record, toqether with the BLKDEF record, provides information about the scope of variables in. the source program. Each BLKOEF reco rd must be followed by a 8LKE~D record. The order of the BLKDEF. debuq symbol records. and BLKENDs should reflect the order of declaration in the source module.
Version 4.(') 808#; O,?ject Module Formats DEBUG. SYMBOLS. RECORD --.
808~ Object Module Formats Version 4.0 The B (Based) bit, if 1, means that the location in MAS defined by the FRAME INFORMATION and OFFSET fields contains a value that is the address of a symbol. The L (Long) bit tells the lenqth of this value. L=0 -) 2 bytes L=l -) 4 bytes If L=0 the frame part of the symbol address is the frame q i ven by the FRAME IN FORI"ATION fie ld • defined to be If 8=0, the location defined by the FRAME INFORMATION and OFFSET fields is the location of the symbol.
8~86 Object Module Formats If FRAME ~ETHOD=2, Version 4.0 the DATUM has the format: *****///***** * * * BLOCK INDEX * * * * * * * *****///***** FRAME METHODs of 3 to 7 are illegal. The FRA~E ~ETHOD field also specifies what kind of information is in the OFFSET field (see below). SYMBOL NAME This field provides the name of the symbol.
8086 Obiect Module Formats Version 4.
808fi Object Module Formats Version 4.8 respect to the specifi~d FRA~E (if SEGM.ENT INDEX = 0). Successive data bytes in the OAT field occupy successively higher locations of memory. DAT If one or more FIXUPP records follow then this field provides up to 1024 consecutive bytes of load-time locatable or absolute data. Otherwise, the repeated field is constrained only by the RECORD LENGTH field. (Note on data record size) All qata bytes in a data record must be within the frame specified hy the data record.
808~ Object Module Formats Ve:· sion 4.0 RELOCATABLE. ITERATED.
Version 4.8 8086 Object Module Formats S~GMENT INDEX> 0) or with respect to the specified FRAME (if SEGMENT INDEX = 0). Successive data bytes in the ITERATED DATA BLOCK field occupy successively hiqher locations of memory. ITERATED DATA BLOCK This repeated field is a structure specifyinq the repeated data bytes.
808~ Object Module Formats Version 4.9 PHYSICAL ENUMERATED DATA RECORD (PEOATA) ************************************************* * * * * * * * * FRAME * OFF * * CHK * * REC * RECORD * * TYP 848 * * LENGTH * * NUMBER * SET * OAT * * * * SUM * * * * * * * * * ************************************************* +-rpt-+ This record provides contiquous data, from which a portion of an 8086 memory imaqe may be constructed.
808fi Object Module Formats Version 4.0 PHYSICAL ITERATED DATA RECORD ( P tDA T A,-- *****************************************///*********** * * * * * * * * * * * REC * TYP * 86H * RECORD LENG'rH * * FRAME NUJ\1BER * OFF * ITERATED * * SET * * * * * * * , DATA BLOCK * CHK * * SUM * * * , * * *****************************************///*********** +-repeated--+ This record provides contiquous data. from which a portion of an 8086 memory imaqe may be constructed.
8086 Object Module Formats Version 4.0 LOGICAL ENUMERATED DATA,RECORD -_._. ·------(tEDATA)"---·-· _ . . . _ ... ***********************///***************************** * * * * * * * * * REC * TYP RECORD * LENG'rH * * * ASH * * * * * SEG~ENT INDEX * ENUMERATED* * DATA * * OFFSET * OAT * CHK * * SUM * * * * * * * .
808fi Object Module Formats version 4.0 This field provides up to 1024 consecutive bytes of relocatahle or absolute data.
8086 Object Module Formats Version 4.9 LOGICAL ITERATED DATA RECORD ---(LIDATA)----·- ***********************///*********************///*********** * * REC * * * TYP * RECORD LENGTH • AlH * * * • * * * * SEGMENT INDEX * ~ * * * • ITERATED· DATA * OFFSET * • ITERATED DATA BLOCK * * * * * * CHK • SUM • * * *****.*****************///***~***********.
8086 Object Module' Formats Version 4.8 Same as for the RIDATA record.
8e8~ Object Module Formats Version 4.8 FIXUP RECORD . (FIXUPP) . ***********************///*********** * * * * REC TYP 9CH * * * RECORD LENG'rH' * ** * * * * * * * THREAD or FIXUP CHK SUM * * * * * * * * ***********************///*********** I I +----rpt----+ This record specifies" or more fixups. Each fixup requests a modification (fixup) to a LOCATION within a previous DATA record. Each fixup is specified by a FIXUP field that specifies 4 data: a location, a mode, a target and a frame.
8080 Object Module Formats Version 4.0 The 'Z' is a one bit subfield, currently function, that is required to contain 0. without any defined The '0' subfield is one bit that specifies what type of thread is beinq specified. If 0=0 then a tarqet thread is beinq defined and if 0=1 then a frame thread is beinq defined. METHOD is a 3 bit subfield containinq a number between 0 and 3 (0=0) or a number between 0 and r, (0=1). If 0=0.
808~ Object Module Formats Version 4.8 M is a one bit subfielG that sgecifies the mode of the self-relative (M=0) or segment relative (M=l). fixUDS: (~ote) Self-relative fixups may NO~ be applied to RIDATA, LICATA, or PIDATA records.
808fi Object Module Formats Version 4.8 'r is a one bit subfield that specifies whether the target specified for this fixup is defined by reference to a thread CT=l). or is aiven explicitly in the FIXUP field (T=0). P is specified specified Since a the P bit attribute a one bit subfield that indicates whether the tarqet ~ in a primary way (requires a TARGET DISPLACEMENT, P-0) or in a secondary way (requires no TARGET DISPLACEMENT, P=l).
8086 Object Module Formats Version 4." OVERLAY DEFINITION RECORD (OVLDEFf - -- ***********************///*********1 1'1*********///*********** * * * * * * * * REC * * TYP * * 70H * * * RECORD LENG'fH * OVERLAY * NAME . * OVERLAY LOCATION * * * * ***********************///*********~ * * OVERLAY ATTR * * * * * * CHK SUM * * * * 111*********///*********** This Record provides the overlay name, the location of the overlay in the object file, and the attributes of the overlay.
8086 Object Module Formats Version 4.8 The SA subfield provides information for memory layout. the followinq format: It has **************************~****** * I I I I I , I * * z I Z I Z I Z I Z I Z I S I A* * I I I I , I I * ********************************* Z's indicates that these I-bit field have not been function. These bits are required to be zero. assigned a S (shared) is a I-bit field that.
808~ Object Module Formats Version 4." END RECORD --(ENOREe) ******************************* * * * * * * REC * RECORD * END * CHK * * TYP * LENGTH * TYP * SUM * 78H * * * * * * * * * * ******************************* This record is used to denote the end of a set ot records such as a block. and an overlay. END·TYP ~his field specifies the type of the set.
808~ Object Module Formats Version 4.0 REGISTER INITIALIZATION RECORD - .. ------ .. --fREGiNT,-----44----- *****************************///*********** * * * * * * * REC * RECORD * REG * REGISTER * CHK * * TYP * LENGTH * TYP * CONTENTS * SUM * * 708 * * * * * * * * * * * *****************************///*********** I I +----repeated-----+ This record provides information about the 8086 registers/register-pairs: CS and IP, SS and SP, OS, and ES.
8086 Object Module Formats Version 4.
808~ Object Module- Formats Version 4.1 The format and the interpretation of the above REGISTER BASE field is identical to the LOCAL SY~BOL BASE described in the LOCSYM record.
8g8~ Object Module Formats Version 4.8 MODULE ~ND RECORD ----(MODEND) *****************************///*********** * * * REC * * 8AH * TYP * * * • * * MOD * * TYP * RECORD LENGTH * • * * * * CHK • * SUM * START ADDRS * * * * * * *****************************///*********** . 1 , +conditional+ This record serves two purposes. It denotes the end of a module and indicates whether the module just terminated has a specified entry point for initiation of execution.
Version 4.8 8086 Object Module Formats 'rhe START ADDRS field (present only if MATTR is 1 or 3) has either of the following formats: ***********///*********///***************** * * * * * * END * FRAME DAT DATU~ * * * * * * * * TARGET DATUM * * * * TARGET * D1S* PLACEMENT * I I * * * ***********///*********///***************** I I +conditional+conditional+conditional+ The starting address of a module has all the attributes of any other logical reference found in a module.
8~8~ Object Module Formats Version 4.0 LIBRARY HEADER RECORD -------fCfSHED)------ ************************************************************* * * * * * * * * REC * RECORD * MODULg * BLOCK * BYTE * CHK * * TYP * LENGTH * COUNT .* NUMBER * NUMBER * SUM * * * * * * * A4H * * * * * * * * ************************************************************* This record is the fir~t record in a library file. It immediately precedes the modules (if any) in the library.
Version 4.0 8086 Object Module Formats LIBRARY. MODULE NAMES (LiSNAM) RECORD ***********************///*********** * * * REC * * TYP * * A6H * * * RECORD LENGTH * * * * * MODULE NAME * * * * * CHK SUM ** * * * ***********************///*********** I I +-repeated--+ This record qives the names of all the modules in the library.
808~ Object Module Formats Version 4."0 LIBRARY MODULE LOCATIONS RECORD (LIBLOC) ------~-.- ************************************************* * * * REC * * TYP * RECORD LENGTH * * BLOCK * * NUMBER * * BYTE * NUI~BER * * * * * CHK * SUI., ..
8086 Object Module" Formats version 4.8 LIBRARY DICTIONARY -.-...... R~CORD (LIBDIC) ***********************///***************** * * * REC * * TYP * RECORD LENGTH * * * PUBLIC NAME * * * * CHK * * * 00H * SUM * * AAH * * * * * * * * * * * ***********************///***************** I I +-re~eated--+ I I +----repeated-----+ This record qives all the names of public symbols within the library.
8086 Object Module Formats Version 4.0 COMMENT RECORD (COMENTf--- ***********************************///*********** * * * REC * RECORD * * COM~ENT * * * CHK * * * * TYP * LENGTH * TYPE * COM~ENT * SUM * * * * * * 8SH * * * * * * * ***********************************///*********** This record allows information in object text. translators to include commentary COr-1M EN'r TY PE This field indicates the type of comment carried by this record.
8086 Object Module Formats Version 4.8 COM(t1ENT This field provides the commentary information.
SgS6 Object Module Formats Version 4.
Version 4.8 8086 Object Module Formats APPENDIX 2 TYPE REPRESENTATIONS The leaves in the following diagrams may be Numeric Leaves without relations, Strinq Leaves, Index Leaves or Null Leaves. Andleaves and Orleaves are not supported at this time. Types may be defined by branches of the followinq forms: +------~~+----~-----+---~~----------+ I SCALAR I (length) , (scalar type) , +--~-----+~--------+~---~------~--+ +------... _---+ I POINTER , +-----.
8086 Object Module Formats Version 4. +----~------+-~-----+ I PARAMETER I ~type I +--~-~------+-----+-------+-~-~~-----+---~--~~~~---------~----+-------+ I PROCEDURE I nil I ~type I (return) , (number of parameters) I Alist I +~----~-----+--~--+-------+----------+-----------~------------+-~-----+ +-------+-----+---~------+ I LABEL I nil I (return) I where -(scalar type)· can be either UNSIGNED INTEGER. SIGNED IN'rEGER. or REAL.
version 4.e 8086 Object Module Formats APPENDIX 3 SYNTAX DIAGRAMS +------------+ --+-->1 sequence 1 +----------+ I I .I +---------+ 1-->1 library 1 +---------+ sequence +--... -----+ --+-->1+___ module ___ _+1--+--> 1 A ~ +------~--~----~+ library -~~( LIBHED )--+---------------+-->( LIBNAM )-->( LIBLOC )-->( LIBDIC )--> ~ I ~------~ ~~--------~~-~+--1 module 1<--+ -~~~~~-~ +--------+ +---------+ module +------+ --+-->1 tmod 1--+--> I I -+------+ ..
8086 Object Module Formats Version 4"" tmod . .---+ +-----------+ +------------+ +---~~---- -->( THEADR ) -> I sqr table ,-+---~~--~---+--+---~~-------~---+->I modtail 1-. . +-------------+ 1 +---------+ +-1 component 1<-+ +------------+ Imod +~ .. ---.----~ +--~- . .----+ -->( LHEADR )->1 sgr table 1-+-----------+--+----------------+->1 modtail 1-+--------.--~ +....____+ I +---~------~+ I --~-+ +-1 data 1<-+ +-It_componentl<-+ --------- +-----.. ft +----_ . . _----+ +------+ rmod +---..
808~ Version 4.0 Object Module Formats sqr _table +-------~-+ __+ qrp -->1+____ seq ~_~ I ________ 1--+---------------+--> A +-->( REGINT )--+ sgor _table +----~ . . ---+ -->1+----~----+ seq qrp 1--+---------------+--+---------------+--> ~ ----~--I f ~~-~~--~ ~ +--( OVLDEF -----...... -- I +--( LNAMgS )<--+ )<--+ --------- +-->( REGINT )--+ -------- I +--( SEGDEF )<--+ +--( TypOEF I )<--+ , ---~~~-~ I ... ..,-~-.., .. I +--( EXTDEF )<--+ I --------, ~- ..
8986 Object ~odule Pormats o _component --~-+---------~~--+--+-~-----------~------+-->( ENOREe )--> ~ +--~---+ , - +-~--~--------+ I -----~-- +--1 data 1<--+ +--1 t_component 1<--+ +~---~~+ +------~------+ t. _component -->( 'fHEADR )--+------------------+--> +_ ... _---------1 A +--1 compOnent 1<--+ +-----------+ component +--.. ------~-- ..+ data 1--+--> +--...
8e8~ Object Module Formats Version 4.rtJ iata +---------------+ =____ --+-->1 content I + ____ ___ deE +1---+--> ~ I +------------+ A I +-->1 thread def 1--->+ I +----~--.:----+ I I -------I +---->( TYPDEF )----->+ t -------I , -------I +---->( PUBDEF )----->+ I --~----~ I -----~-I I +---->( EXTDEF )----->+ ..
88.8~ Obj ect Mod ule Pormats content def --+-->( LIDATA )---+--+---------------+--> I ---~-~-~--~~--I -------I +--( FIXUPP )<--+ I +--> ( LEDATA ) -->+ ------I ---~-~-I ---~---I I +-->( PIDATA )-->+ , ----~--I I -------I +-->( PEDATA )-->+ I ----~~-I I -------I +-->( RIDATA )-->+ I --~-~--I -~---~-, I +-->( REDATA )-->+ A thread def --->( FIXUPP )--> 9~ ~ote: Must contain thread fields only. Version 4.
808~ Object Module Formats Version 4.9 APPENDIX 4 EXAMPLES OF FIXU~S This appendix was originally written in November 1977, and supplemented a paper, now obsolete, called "Overview of Proposed 8086 Fixupsd. It is included here because it provides copious examples of fixups in pictorial represe~tation, and therefore is an aid to understandinq the 8086 fixup meehanisms. In the followinq examples, we assume that LINK is the name of a linker and LOCATE is the name of a locater for the 808~ R&L system.
868~ Object ~odule Formats PART 1. Version SELF-RELATIVE 4.a REFERE~CES , PPPPPPPPPPPPPPPPPPPPPP P P pp - - - - - - - - - pp P P p p p P P +------~------+ P P +-----~ P TARGET ..-.. --..-+ P P P p P P P P P p p P P +--~.----------+ LOCATION +.......... ~- ....-----..+ P P P P P p P P P P P P P P P <- PT P P P <- PP p P P P P <- PSEG -> P P P P I PPPPPPPPPPlppppPPPPPPP p P I p p-1p P I P P P P I +.. _-_ .... __ .. P P P LOCATION P P +_ .. _-------_ ....
909~ 1 Object Module Formats Self-Relative Intraseq~ent Version 4.
808~ 1.2 Object Module Formats Version 4.1 Self-Relative Interseqment References Self-relative jump or call to another segment. Example: A LLLLLLLLLLLLLL <- pp L L _--+ L L LOC L ,-----~------L +--.-------+ L I L L L L L L LLLLLLLLLLLLLL B +--_ ...... LLLLLLLLLLLLLL L L L L L L L L TARGET I L L +~----- -+ L L L LLLLLLLLLLLLLL ---------->1+--------+ Both LSEG's are created in the , dl I V <- P'E .. S~Me translation. FIXUP. REPRESENTATION: - ..-- --_.-.
8086 Object Module Formats ~OCA'rE Version 4.' OPERATION: At LOCATE time these various sample possibilities can be detec,ted': 3. PPPPPPPPPPPPPPPPPP P P P pp P LLLLLLLLLLLLLL P <- pp. P LLLLL'LL·LLLLLLL P (- PI LLLLLLLLLLLLLL P'LA' L P P LA L P L L~ P L +--------+ L P L' +--------+ L P L +--------+ L P 'p L I LOC L P P L I LOe L I LOe I L I L P P L +--------+ L P P L +--------+ L P L +--------+ L P L L P P L L L L P I I I P LLLLLL1LLLLLLL P LLLLLLILt.LLLLL P LLLLLLILLLLLLL P p p p P P I I I p P.
808~ Object Module Formats Version 4.~ Oiaqrams land 2 show valid fixups. In diaqram 3, the TARGET is not in the defined PSEG. A warning will be qiven by LOCATE. In diagram 4, if the choice for PSEG is chanqed from SICA) to SICS) then the fixup can be made, as in diagram 5, if the displacement is qreater than 32K a ·clever- fixup, shown in diaqram 5 as an exclamatory arrow, will beqenerated. R & L attempts to inform the us~r of any erroneous self-relative references.
8086 Object Module Formats 3 Version 4.8 Self-Relative Reference To An EXTERNAL Symbol A LLLLLLLLLLLLLL L L L L L LOC L L (- PP ? •••••••••••••• • • •••••••••••• SYM •• • •••••••••• • +--------+ L I 1-------------------->. +--------+ , L <- PT • ••• •••••• ••••• LLLI.
Version 4. S886 Object Module Formats EX'fERNAL symbol (SYM) is found (by LINK) to be in the same CASE 1: as the reference. The followin1 four cases exist. Assume that PSEG is sgecified as .. PSeG: PPPPPPPPPPPPPPPPPP P P p P P P P LLLLLLLLLLLLLL P P L +..---~---+ L P p L LOe L p L P P L L P P L I L P P L I P L L P I VP L L P P L ---+ L P L P P L I TARGET L P P L +-_ .... L P P L P LLLLLLLLLLLLLL P PPPPPPPPPPPPPPPPPP <- PP <- PT +--------.f. , _----+ +----..
8~86 Object Module Formats Version 4.1 CASE 2: EXTERNAL symbol (SYM) is found to be in a different LSEG, The followinq diaqram then applies and LINK converts the fixup to: B. LOCATION: (no change) (no chanqe) TARGET: SI(8) ,dl or SI(8) where dl is app~ied to LOCATION depending on original TARGET specification. LINK will specify the new TARGET in a primary (secondary) way if the old TARGET was spe=ified in a primary (secondary) way.
8086 Object Module Formats CASE 3: EXTERNAL symbol (SYM) Version 4.1 is found (by LINK) to be absolute. LINK will chanqe the fixup to the followinq: LOCATION: same PSEG: same TARGET: pi (SYM) ,d(SYM) where pI and d are from a PUBLIC DECLARATIONS record or pt(SYM), and d(SYM) is applied to LOCATION.
8086 Object Module Formats l.4 Version 4.8 (8089) Self-Relative Reference To An EXTERNAL Symbol A LLLLLLLLLLLLLL L <- PP ? •••••••••••••• L • • +--------+ L •••••••••••• L I LOC 1-------------------->. SYM • • . .......... . L +--------+ L L L L <- PT .............. LLLLLLLLLLLLLL FIXUP REPRESENTATION: LOCATION: OFFSET PSEG: SI (A) (thi s i s the most common cho ice) TARGET: EI(SYM) rd or EI(SYM) if the offset is in LOCATION There are two waY$ in which an external symbol may be resolved.
808~ Object Module Formats CASE 1: EXTERNAL symbol LSEG, B. (SYM) Version 4, is found (by LINK) to be in a LINK OPERATION: LINK will change the above fixup to the fo110win~: LOCATION: (no change) PSEG: (no change) TARGET: SI(8) ,d1 wheredl is equal to the sum of d (if any) and the symbol offset. A B LLLLLLLLLLLLLL LLLLLLLLLLLLLL L L L L L L L L L L L L L L L L L LOC L I-------~--~-~------). TARGET L L L L L L L L L L L L LLLLLLLLLLLLLL LLLLLLLLLLLLLL ........... ..........
8086 Object Module Formats Version 4.0 Diaqrams land 2 show two commom cases. R&L attempts to inform the user of any erroneous self-relative references (TARGET not within 32K from LaC). The 'symbol beinq referenced must be within the defined LSEG independent of the value at LOCATION to be applied: EXAMPLES: J~P SYM + 10 or JMP SYM - 2 The symbol SYM will have an offset within its containinq LSEG. The values 10 and -2 are siqned numbers.
8986 Object Module Formats CAse 2: EXTERNAL symbol (Sy~) Version 4.t? is found (by LINK) to be absolute. LINK~OPERA;rION LINK will chanqe the fixup to the following: LOCATION: (no chanqe) PSEG: (no chanqe) TARGET: pI (SYM) ,o(SYM) + d where pi and 0 are from a PUBLIC DECLARATIONS record and the sum is performed as in Case 1.
Version 4.0 8086 Obj ect Mod ule Fo rmats PART 2. SEGMENT RELATIVE REFERENCES MMMMMMMMIMMMMMMMMMMMM~MMMMMMMMMMMMM M M M M , I-F8VAL ~ 1\1 I M M V f't1 M M M M .'4 M M t4 M '" P P P P P P M P M M P P M P ~ P P P r-1 M 1'4 M M PPPPPPPPPPPIPPPPPPPP P P P , , p I LLLLLLLLILLLLL L L L FOVAL-I L V L L L +-~------+ L TARGET L L L +------_ ... _+ L L L L L L L L L L L L L LLLLLLLLLLLLLL , , P P / <- canonic P P P P P P P P P P P P !'1 <- PP ...
8086 Object Module Formats Version ~o 2.1 Seqment-Relative Pointer Reference (lonq call) With 80th LSEG's Created In Same Translation A LLLLLLLLLLLLLL B LLLLLLLLLLLLLL L L L L L L L L L L L L L L +------.---+ L L LOC TARGET I L L I--~---------------->I +-----_.-_+ L L L L. L L L L L L L L LLLLLLLLLLLLLL LLLLLLLLLLLLLL +---------+ +--------+ I 4.' GroupinQ and <- PP <- PT d1 I V REPRESENTATION: FIXUP. .--.-. - ---.
8086 Object Module Formats Version 4.0 LOCATE OPERATION: At LOCATE time: 1. The BASE (FBVALl is canonic PSEG defined by PP. determined by the PSEG directive as the 2. The offset is a positive value, less than or equal to ~4K, from the determined PSEG. LOCATE includes as part of the offset, FOVAL, the difference between the absolute location of the LSEG and the absolute location of the PSEG defined by the LSEG. (This difference will be less than 16.
8086 Object Module Formats 2.2 Version 4.9 Seqment-Relative Pointer Reference (lonq Where Reference is to an EXTERNAL Symbol A call) wil.h No ·............. ....SYM ...... · ..........• ·· ·............. LLLLLLLLLLLLLL ? L L L +---.---~-+ L • LOe L ,---~----.------------>. L +---..----+ L • L L LLLLLLLLLLLLLL Groupinq <- PP <- PT FIXUP REPRESENTATION: ~--------- ... ~.
898~ Object Formats ~odule Version 4.0 CASE 1: EXTERNAL symbol (SYM) is found (by LINK) to be in the same LSEG as the reference. An example would be a reference to data (ROM DATA) stored in CODE seqment A. The PSEG is then determined by LINK to be SI(A) as the default, since no groupinq is specified. The followinq two cases may be found: PPPPPPPPPPPPPPPPPPPPPPPPP P P LLLLLLLLLLLLLLLLL P P LA L P P p L P L L L P P p P L L P L L P LOC P L L P L L P P L P L P P LLLLLLLLLLLLLLLLL P L?=A P P L +---_. .
808~ Object Module Formats Version 4.8 CASE 2: EXTERNAL symbol (SYM) is found (by LINK) to be in a different LSEG, B. This case becomes the same fixup described in (2.1) • CASE 3: Ex·rERNAL symbol (SYM) is found (by LINK) to be absol ute. The PUBLIC declaration record for SYM will define an absolute address of the form PSEG, OFFSET. LINK chanqes the fixup to: LOCATION: same PS EG: P# (SYM) TARGET: ptCSYM) ,dCSYM) _ or pt(SYM) (where d(SYM) Note that this fixup is completely LOEA~~_.Qf.~~~!I.
808~ 2.3 Version 4.8 Object Moduie Formats Seqment-Relative Pointer Reference (lonq call) With Groupinq This fixup is' much the same as the fixups described in (2.1) and The only difference is that the PSEG is always specified to be a qroup base. The fixup would appear as one of the followinq (also see diaqram below): (2.2).
8086 Object Module Formats 2.4 Version 4.!.J Seqment-R~lative Offset Reference (data reference) With No Groupinq And Both LSEG's Created In The Same Translation Diagram in (2.1) can be used. LOCATION: OFFSET PSEG: TARGET (this is the most common choice) TARGET: SI(8) ,dl or SI(8) where dl is applied to the LOCATION Note that this fixup is exactly the same as the Seqment-Relative Pointer Reference shown in (2.l) with one exception: the LOCATION requires no BASE fixup.
8086 Object Module Formats 2.5 Segment Relative initial ization) Base Version Reference (used for seqment 4." reqister This fixup is much the same as the Seqment-Relative Pointer Reference described in (2.1). The only difference is that the offset part, FOVAL, of the fixup is not required. FIXUP REPRESENTATION: LOCATION: BASE PSEG: TARGET TARGET: SI (B) This allows the base address (canonic PSEG) of LSEG B to be used.
INTEL CORPORATION, 3065 Bowers Avenue, Santa Clara, California 95051 (408) 987-8080 Printed in U.S.A.