6.1 OMF Output Format
From 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.
| Type | Description | |
|---|---|---|
| THEADR | 1 | Marks the start of an object module, contains the name of the source file. |
| COMENT, class A1h | 1 | MS extension; tells linker the CodeView version number. Emitted if -Zi option is active. |
| COMENT, class E9h | n | Borland-style auto-dependency record(s). Emitted if -Zd or -Zi options are active. |
| COMENT, class 9Eh | 1 | MS extension; directs the linker to use a "standardized" segment ordering. Emitted if the .DOSSEG directive is found in the source. |
| COMENT, class 9Fh | n | Default library search name(s). Emitted if INCLUDELIB directives are used. |
| LNAMES | n | Defines names for segments and groups ( optionally also for externals, communals and publics ). |
| SEGDEF | n | Defines segment(s). |
| COMENT, class FEh | n | Tells WLink to do FARCALL optimization for a specific segment. Suppressed with -zld. |
| GRPDEF | n | Defines group(s). |
| EXTDEF | n | Defines external(s). |
| COMENT, class A8h | n | Defines weak external(s). Emitted if EXTERN directive is used with "altname". |
| COMDEF | n | Defines communal(s). |
| ALIAS | n | Defines alias(es). |
| PUBDEF | n | Defines public(s). |
| COMENT, class A0h | n | Defines export(s). Emitted if the EXPORT attribute is used in a PROC directive. |
| COMENT, class A2h | 1 | Link Pass Separator. Emitted if no entry point is defined in this object module. |
| LEDATA | n | Data record; defines segment content(s). |
| FIXUPP | n | Contains information to make the linker resolve references between object modules. |
| LINNUM | n | Line number information. Emitted if -Zd or -Zi option is active. |
| COMENT, class FDh | n | Tells disassembler that a code segment contains data. Suppressed with -zlc. |
| MODEND | 1 | Marks the end of the object module; optionally defines the entry point. |
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.