I am following the brokenthorn operating development series to study about bootloader. In this page , these are the three line of code :
bits 16 ; We are still in 16 bit Real Mode
org 0x7c00 ; We are loaded by BIOS at 0x7C00
start: jmp loader ; jump over OEM block
In second line He loaded the bios at 7c00 in floppy. why not on 0000? I checked at Where to store the bootloader on a floppy image?. Here also the same thing has given. But the reason has not explained. Can anybody explain this to me please? Thanks in advance.
EDIT : I am getting confused because in the same site in a later tutorial the codes are :
bits 16 ; we are in 16 bit real mode
org 0 ; we will set regisers later
start: jmp main ; jump to start of bootloader
and then in main
main:
;----------------------------------------------------
; code located at 0000:7C00, adjust segment registers
;----------------------------------------------------
cli ; disable interrupts
mov ax, 0x07C0 ; setup registers to point to our segment
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
Now here why he used org 0? And then why he copied the address to all the registers? Sorry if this is a foolish question. I am very new to assembly programming and just started to read about the bootloaders.