Page 1 of 1
How to address above 4GB using assembly language ?
Posted: Thu Nov 01, 2007 5:14 am
by prayag.ganoje
Can any one tell me how to represent the physical address above 4GB using assembly language... viz
?
Posted: Thu Nov 01, 2007 5:44 am
by JamesM
Using PAE or long mode? In a x86_64 machine all registers are 64 bits long anyway...
Re: How to address above 4GB using assembly language ?
Posted: Thu Nov 01, 2007 6:15 am
by Brendan
Hi,
prayag.ganoje wrote:Can any one tell me how to represent the physical address above 4GB using assembly language... viz
?
For 32-bit code you'd do it the exact same way you'd store any other 64-bit integer. For example, EDX might hold the highest 32-bits of the address and EAX might hold the lowest 32-bits.
If you're wondering how to access a 64-bit address in 32-bit assembly, the simple answer is you don't. Without paging you can't access anything above 4 GB, and with paging (PAE or PSE36) you're still using 32-bit linear addresses. To access a 64-bit physical address you need to map the page containing the address into the 32-bit linear address space, then use a 32-bit linear address to access it.
Cheers,
Brendan
Posted: Sat Nov 03, 2007 10:01 am
by rv6502
have a look at how EMS memory works, how a C128 can have more than 64KiB of ram, how a C64 can have 64KiB ram + 32Kib ROM, how a NES can access 1MiiB ROM cartridges, etc.
http://en.wikipedia.org/wiki/Bank_switching
you can implement something similar using paging
good luck