above 1MB in real mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
anon19287473
Member
Member
Posts: 97
Joined: Thu Mar 15, 2007 2:27 pm

above 1MB in real mode

Post by anon19287473 »

In real mode, what is stopping you from getting up to 1MB? Is it the 16 bit addressing? Could you work around this by mergin registers or something?
:D
User avatar
muisei
Member
Member
Posts: 79
Joined: Sat Sep 23, 2006 2:10 pm
Location: Bulgaria
Contact:

Post by muisei »

The real mode addressing works like this: multiply the segment regiser by 0x10 and then add the offset.
The size of the segment registers is 16 bits and the offset size is also 16 bits.You can address 0xFFFF different segments the maximum offset is 0xFFFF.The address of the last byte is calculated as follows: (0xFFFF*0x10+0xFFFF)=0x10FFEF.This is 65519 bytes above the first MB.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

You should be aware of the Gate A20 line: when its disabled addresses are ANDed by 0xffefffff, which causes 0x10FFEF to become 0x00FFEF...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply