What does ORG Assembly Instruction do?

前端 未结 5 1387
花落未央
花落未央 2021-02-01 01:12

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.

5条回答
  •  梦如初夏
    2021-02-01 01:34

    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.

提交回复
热议问题