The ORG Directive and Actual Offsets (39441)
The information in this article applies to:
- Microsoft Macro Assembler (MASM) 5.1
- Microsoft Macro Assembler (MASM) 5.1a
- Microsoft Macro Assembler (MASM) 6.0
- Microsoft Macro Assembler (MASM) 6.0a
- Microsoft Macro Assembler (MASM) 6.0b
This article was previously published under Q39441 SUMMARY
The ORG directive in MASM does not necessarily produce an actual
offset that matches the offset specified by "ORG XXX". For example, if
you use "ORG 100h" in your program, the following code will not always
begin at the 100h offset relative to the start of the segment.
When you are using a .COM source file and there is only one module,
the "ORG 100h" will result in an actual offset of 100h for the code
that follows the ORG statement. This behavior also occurs with
segments with AT combine type (in which case segments are not combined
by the linker, and no data or code is defined).
However, if you have multiple modules and/or you are not dealing with
a .COM source file, the "ORG 100h" produces an actual offset, which is
somewhat greater than 100h.
This behavior occurs because the linker, in these circumstances, will
do some padding that you have no control over.
Modification Type: | Major | Last Reviewed: | 10/29/2003 |
---|
Keywords: | KB39441 |
---|
|