Babystep1: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
m Bot: Replace deprecated source tag with syntaxhighlight
mNo edit summary
 
Line 21:
times 512-($-$$) db 0
</syntaxhighlight>
The CPU starts in real mode and the [[BIOS]] loads this code at address 0000:7c00. "<code>times 512-($-$$) db 0"</code> is NASM's way of saying fill up 512 bytes with zeroes, and partcopy is going to expect that (200 in Hex = 512 in Decimal). Change it and partcopy will likely fail.
 
There is often a boot signature (0xAA55) at the end. Older versions of some BIOSes looked for this in order to identify a boot sector on a disk. It is evidently unnecessary nowadays, unless you're running the code on a legacy BIOS, or in QEMU. If it's needed, the last line would be replaced with (or some version of it):