6.1 OMF Output Format

Asmc Macro Assembler

6.1 OMF Output Format

The OMF format fully supports the segmented architecture of the x86 cpu. The specification has been extended around 1990 to support 32-bit, including the FLAT memory model. However, since it's a bit old now, there's no support of some of the new relocations introduced for 64-bit.
  • OMF won't support the IMAGEREL and SECTIONREL operators.
  • JWasm currently won't emit OMF LIDATA records ( unlike Masm). This means that if the assembly source contains lots of arrays defined with DUP, the object module might become significantly larger than a similiar object module written by Masm.
  • JWasm emits a few COMENT records that Masm won't. These are remnants of Open Watcom's WASM; they may be suppressed with commandline options -zlc and -zld. They shouldn't do any harm, though.
The OMF object module consists of records of certain types. JWasm writes those records in the following order:
TypeDescription
THEADR1Marks the start of an object module, contains the name of the source file.
COMENT, class A1h1MS extension; tells linker the CodeView version number. Emitted if -Zi option is active.
COMENT, class E9hnBorland-style auto-dependency record(s). Emitted if -Zd or -Zi options are active.
COMENT, class 9Eh1MS extension; directs the linker to use a "standardized" segment ordering. Emitted if the .DOSSEG directive is found in the source.
COMENT, class 9FhnDefault library search name(s). Emitted if INCLUDELIB directives are used.
LNAMESnDefines names for segments and groups ( optionally also for externals, communals and publics ).
SEGDEFnDefines segment(s).
COMENT, class FEhnTells WLink to do FARCALL optimization for a specific segment. Suppressed with -zld.
GRPDEFnDefines group(s).
EXTDEFnDefines external(s).
COMENT, class A8hnDefines weak external(s). Emitted if EXTERN directive is used with "altname".
COMDEFnDefines communal(s).
ALIASnDefines alias(es).
PUBDEFnDefines public(s).
COMENT, class A0hnDefines export(s). Emitted if the EXPORT attribute is used in a PROC directive.
COMENT, class A2h1Link Pass Separator. Emitted if no entry point is defined in this object module.
LEDATAnData record; defines segment content(s).
FIXUPPnContains information to make the linker resolve references between object modules.
LINNUMnLine number information. Emitted if -Zd or -Zi option is active.
COMENT, class FDhnTells disassembler that a code segment contains data. Suppressed with -zlc.
MODEND1Marks the end of the object module; optionally defines the entry point.
LEDATA, FIXUPP and LINNUM records usually are intermixed; a FIXUPP and/or a LINNUM record appears immediately after the LEDATA record to which it refers.
Since v2.11, multiple THEADR records are written if cmdline options -Zd or -Zi are set and line number information is written for more than one source file; this conforms to MASM behavior.