What are all the aspects must be taken into account when designing your software into 64-bit environment, and why wouldn’t the same code work as 32-bit and 64-bit (when talking about applications)?
Drivers obviously are a different beast, missing 64-bit drivers are infamous problem for almost all hardware. What’s so different in that domain that it’s next to impossible to find drivers?
Why is it so hard to make 64-bit versions of software?
Edit: Let’s forget the basic flaws of old, buggy software with magic numbers, etc. and think you’d create the software yourself, to be compatible with both. What aspects do you need to take into account, and are there things you just can’t overcome with current compiler design? All the missing 64-bit software can not simply be because people like code with magic numbers?! 🙂
Conclusion: It seems to be all about human laziness and historical reasons, instead of technical reasons.
One specific reason why this might be hard is that pointer sizes are going to be different. Instead of a pointer taking up 32 bits, a pointer would now take up 64 bits.
That’s a problem if the software somewhere shoehorns a pointer into an
intvia areinterpret_castin C++ (which may occur in some really low level code), and it happened to work because the size of anintand a pointer were the same size. Basically, the code assumed a certain size for a pointer.Another way that can bite back is if the code is littered with magic numbers like
4instead ofsizeof(void*), or0xffffffffinstead ofINT_MAXor something similar.There might not be a 64-bit version of a software if it depends on a library or a function that is not available in 64 bits. You can’t have an application that is part 32 bits and 64 bits. For example, in Windows, there’s a function called
SetWindowLongthat can only accept 32-bits of data, so it’s not very useful for 64-bit programs if a pointer needs to be passed to the function. That’s why there’s a function calledSetWindowLongPtrthat can handle up to 64-bits in 64-bit programs and 32-bits in 32-bit programs.Note that Internet Explorer runs on 32-bits by default even on 64-bit windows, because a huge majority of plugins for it are available only in 32-bits. A big example of this is the Adobe Flash Player, which is available only in 32-bits. So, apparently even for a big company like Adobe, porting for 64-bits may not always be trivial.
Bitshifting operations may be affected. For example, bit shifting
0x80000left 10 times in 32 bits gives you0x0, but bit shifting0x80000left 10 times in 64 bits gives you0x200000000.All that being said, there’s no real technical reason why it’s too difficult to port an application to 64-bits if the code was written well. The best case scenario is that a simple project reconfiguration and complete rebuild is all that’s needed.
The cynical side of me say that companies use this as a way to implement planned obsolescence – force or encourage people to upgrade to/purchase the newest products!