Does NASM need org 0x7C00 to assemble boot sectors correctly?
Posted: Mon Jun 23, 2025 8:09 pm
Is it necessary to write org 0x7C00 in assembly so that NASM calculates addresses starting from 0x7C00?
The Place to Start for Operating System Developers
https://f.osdev.org/
Code: Select all
push word 0x7c0
push word start
retf
start:
I'm not very practiced in x86 asm, but isn't this just a longer, unclear version of JMP 0x07c0:0000? Also, it makes the assumption that SS:SP points to a region of RAM which doesn't conflict with anything. I've heard many times that you should never do this, always set SS:SP first.wishedtobe wrote: ↑Tue Jul 29, 2025 1:19 am I suggest youat the very beginning.Code: Select all
push word 0x7c0 push word start retf start:
I forgot that. I'm too accustomed to the instruction retf.eekee wrote: ↑Tue Jul 29, 2025 2:34 am I'm not very practiced in x86 asm, but isn't this just a longer, unclear version of JMP 0x07c0:0000? Also, it makes the assumption that SS:SP points to a region of RAM which doesn't conflict with anything. I've heard many times that you should never do this, always set SS:SP first.![]()