64-bit OS refers to the bit width of the general purpose registers. It's able to process 64 bits (data + operations) at a time.
We know that in order for the 64-bit system to be truly useful, programmers need to write 64-bit applications.
However, I wonder what the difference is between a 32-bit application and a 64-bit application? I'm not asking what configuration changes I need to make to compile a 64-bit application; instead, I'd like to know the structural differences of the two applications in memory.
For example, a C program on Linux would typically look like this in memory:
- text segment
- initialized data segment
- uninitialized data segment
- heap
- stack
I'd imagine the 64-bit application would look the same in terms of layout structure in memory, except that the address for each byte (assuming byte addressable system) has more bits. If that's true, what does the 64-bit imply? simply larger addressable memory space?
Also, when a 64-bit application is compiled, let's assume one instruction in the source code is compiled into the add MIPS instruction in assembly code:
add $1 $2 $1 // $1 += $2;
Each MIPS instruction is encoded in exactly 32 bits. So here's the question, if an application is configured to be compiled as a 64-bit app, what would the add
instruction look like? does it still have 32 bits or is it extended to 64 bit which breaks the MIPS rule? If it's still 32 bits, I don't see what difference a 64-bit app make so that it "brings 64 bit OS into full play".
Please enlighten me.