0% found this document useful (0 votes)
2K views1 page

ORG 100h

ORG 100h is a compiler directive that tells the compiler to calculate variable addresses starting at an offset of 256 bytes into the executable file. This is because operating systems store program metadata in the first 256 bytes of code segments for COM files. While EXE files are loaded at offset 0000 and use separate segments for variables, ORG 100h remains important for addressing variables when working with COM files.

Uploaded by

mani_vlsi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views1 page

ORG 100h

ORG 100h is a compiler directive that tells the compiler to calculate variable addresses starting at an offset of 256 bytes into the executable file. This is because operating systems store program metadata in the first 256 bytes of code segments for COM files. While EXE files are loaded at offset 0000 and use separate segments for variables, ORG 100h remains important for addressing variables when working with COM files.

Uploaded by

mani_vlsi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

ORG 100h is a compiler directive (it tells compiler how to handle

the source code). This directive is very important when you work
with variables. It tells compiler that the executable file will be loaded
at the offset of 100h (256 bytes), so compiler should calculate the
correct address for all variables when it replaces the variable names
with their offsets. Directives are never converted to any real
machine code.
Why executable file is loaded at offset of 100h? Operating system
keeps some data about the program in the first 256 bytes of the CS
(code segment), such as command line parameters and etc.
Though this is true for COM files only, EXE files are loaded at offset
of 0000, and generally use special segment for variables.

You might also like