views:

51

answers:

2

This is what it looks like on my laptop with less than 4G:

0x004012f1 <main+0>:    push   %ebp
0x004012f2 <main+1>:    mov    %esp,%ebp
0x004012f4 <main+3>:    sub    $0x18,%esp
0x004012f7 <main+6>:    and    $0xfffffff0,%esp

Can someone using RAM larger than 4G paste a dump?

I think it should be no longer like 0x004012f7 as its capacity is only 2^32=4G

A: 

On a 32bit OS, the addressable space will indeed only be 2^32 = 4Gb.

On a 64bit OS (assuming a 64bit application), it will be 2^64, which is much much larger.

Oded
I just corrected 2^32 should be 4G,so on a 32bit os,RAM larger than 4G is just a waste,right?
Mask
@Mask - usually, but not necessarily, there are physical address extensions available as well.
Nick Craver
@Oded,can 64bit application be run on 32bit OS?
Mask
@Nick Craver,how will the disassemble look like then?
Mask
@Mask - Posted a sample since you're curious :)
Nick Craver
@Mask - no, 64bit apps cannot be run on a 32bit OS.
Oded
@Oded ,but 32bit apps can be run on 64bit OS?
Mask
+1  A: 

Here's a sample from my 64bit OS, the addresses are just twice as long like you'd expect...twice the address length to address 2^2*n bytes:

000000007729EE15  ldmxcsr     dword ptr [rcx+34h]  
000000007729EE19  fldcw       word ptr [rcx+100h]  
000000007729EE1F  mov         rsp,qword ptr [rcx+98h]  
000000007729EE26  mov         rcx,qword ptr [rcx+0F8h]  
Nick Craver
BTW,isn't there a `0x` prefix on 64bit OS?
Mask
@Mask - Just a matter of how different debuggers show it in output is all, the address is after the x.
Nick Craver