My Bootloader Does Not Work: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Increased header depths by 1 to match the header formatting used on the rest of the wiki
Combuster (talk | contribs)
Line 17:
 
In real mode, memory is always accessed as segment*16 + offset. There's always a segment involved, and there's always an offset involved in anything real-mode related. Now that you have your map, you'll have to find yourself pairs of segments and offsets that point to each of those addresses. There are three standard methods of going at it.
-* '''The segment is zero, making the offset the physical address.''' This limits you to the first 64k of memory, but that might also exactly be the memory you want.
-* '''The offset is zero, making the segment the physical address divided by 16.''' You're not allowed to round off. You also need to be careful with that you need to set segment registers all over the place.
-* '''The offset is the lowest 16 bits of the address, and the next four bits end up in the segment followed by three zeroes'''. Write it out on paper. It's more complicated, but it works for any address in the 640K you could think of.
 
=== There's no ORG statement ===