What does ORG Assembly Instruction do?

sepisoad picture sepisoad · Aug 4, 2010 · Viewed 74.8k times · Source

can anyone give me a comprehensive description about ORG directive?
When and why is it used in assembly written applications?

Using Nasm on x86 or AMD64.

Answer

Paul R picture Paul R · Aug 4, 2010

ORG is used to set the assembler location counter. This may or may not translate to a load address at link time. It can be used to define absolute addresses, e.g. when defining something like interrupt vectors which may need to be at a fixed address, or it can be used to introduce padding or generate a specific alignment for the following code.