What does ORG Assembly Instruction do?

前端 未结 5 1400
花落未央
花落未央 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:51

    its the location in memory where you want the binary program to be loaded to, if any.

    I prefer not to use org, and just issue out straight opcode/value to hardware. you can always store values in ax and transfer between bx, cx, dx.

    I'm writing my own assembler to dish out opcode/value without having to worry about sending it to memory first before executing,

    Its so much faster just to execute opcodes on the spot as they're being read, rather than trying to cache them into memory risking overloading the stack which might burn out your cpu

提交回复
热议问题