Must you use
org 0x7C00? No. Should you use
org 0x7C00? Probably.
I believe the
org 0x7C00 is only half the equation and here's why.
Giving a value using
org, only defines the
offset part of the equation. It isn't going to make any difference what offset you use if you don't also set the
segment portion as well.
For example, if the BIOS set DS to 0x07C0 and you use an
org of 0x7C00, you aren't going to get the address you think you are. When you think about what value you will use with the
org line, you must also think about what matching value you must place in the desired segment register.
Using a value of 0x07C0 in DS, you then most surely should use a value of 0x0000 in the
org line. However, since many segment:offset combinations can point to the same physical address, you can use many of these combinations to get the same result.
Can I set DS to 0x0123 and use an
org line value of 0x69D0? Absolutely. (0x0123 * 16) + 0x69D0 = 0x7C00.
The usual question comes to light when the CS segment register is in question. Must I use an
org of 0x7C00? Again, the answer is no. The BIOS has placed you at physical address 0x7C00. As long as you use a CS and
org combination to point to that same address, it doesn't matter what that combination is. Therefore, as long as you use all relative branching (jmps, jccs, and calls), don't use a
cs: override, or use a few other rarely used techniques, you really don't have to worry what the CS:IP register set is. If the BIOS didn't set them to a valid value, your boot code wouldn't be executed anyway.
There are two most used techniques. The first, is to set DS and ES to 0x07C0 and use an
org of 0x0000. The second is to set DS and ES to 0x0000 and use an
org of 0x7C00. Either way, you must not assume a value in the DS or ES register, and must set them to one or the other value when using one of these two techniques.
To further this, a normal technique is to set SS to 0x0000 and SP to 0x7C00 so that the first push to the stack will be just below the boot sector.
That's just my 2 cents.
-- Ben
https://www.fysnet.net/osdesign_book_series.htm