What is the actual difference in terms of source code when writing a 64 bit program? For example is only the assembly different? It’s not like there’s a 64 bit version of C++. If it’s something as simple as an option on the compiler than how come more programs aren’t natively 64 bit? If the only difference of 32 bit vs 64 bit CPU is the register size, I can’t see how that affects a program (aside from being able to address more memory).
Share
Not all programs have to be re-written to work on 64-bit platforms. Often, programs are rewritten so as to take advantage of the greater freedoms available on some 64-bit OS, such as larger address space, but that doesn’t mean they have to be rewritten to work.
Some programs might have to be recompiled, leaving source code unchanged. Some programming environments that use an intermediate representation and just-in-time compilation allow the same binaries to run unchanged on 32- or 64-bit OS.
Where native programs need to be rewritten, it is normally due to assumptions about pointer size, as other answers have stated. Some people might call those assumptions bugs.