Search code examples
assemblyx86nasmdirective

What does ORG Assembly Instruction do?


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.


Solution

  • 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.