Programming for 64bit OS/PC

Started by
3 comments, last by Degski 18 years ago
What differences are there for programming on 64bit OS rather then 32bit OS? Does the windows API for 64 bit is different then the 32 bit? The size of int is different? A program written for 64 bit cant run on a 32bit OS/PC? Thanks in advance.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Advertisement
Quote:Original post by The C modest god
What differences are there for programming on 64bit OS rather then 32bit OS?

For the programmer, not too much, you only need to take care of some types.

Quote:Does the windows API for 64 bit is different then the 32 bit?

Yes, 64 bit types are larger than 32 bits, but some remain the same. Do a search on MSDN or Google for the exact width. The API has special types and functions to help you.

Quote:A program written for 64 bit cant run on a 32bit OS/PC?

No, because 32-bits cannot handle 64 bit types.
I somehow also don't believe it is possible to run 32-bit apps on 64 bit CPU's either (can someone verify this), but there are some 'emulators' like WoW (Windows on Windows) which allow you to use 32-bit applications on a 64-bit OS.

Overall advice, do a search on Google or MSDN to find out more.
(Hint: www.devx.com and AMD have also some good documents)
Well, AMD64 has a complete IA-32 emulation layer built-in and running at native speeds. For any 32-bit software, it looks and feels like a 32-bit processor. I'd say that a very large majority of AMD64 owners only run a 32-bit OS on it, at this point.

Also, AFAIK, at least 64-bit Linux has no problem running 32-bit applications provided that the processor can handle them. You do need a 32-bit userland, though (libraries and stuff), in addition to the 64-bit one.
I'm fairly certain it's the same for the 600 line of Intel processors - they can emulate at native speeds 32 bit.

Somone please correct me if I'm wrong - I don't think I am.
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]
Things aren't that different as thery might look. All types are virtually the same (from the programmers persective), so that's not much of a problem, int is still 32bit etc.

Pointers though are now all 64-bit. Pointer-Pointer arithmatic is no problem, mixing pointers and other types might (will) generate conversion warnings, which might, or might not be harmless, depends on the code. Also shifts might be implicitely converted from 32-bit shifts to 64-bit shifts, these need to be checked as well!

Another thing, you cannot mix 32-bit and 64-bit program-components, so if you call a function in a DLL from a 64-bit program, it needs to be 64-bit as well.

With this precursor, all 32-bit software will run perfectly well, and it's said in certain cases even better than on a 32-bit XP. The AMD64 architecture ensures that no penalty is incurred running 32-bit soft on 64-bit OS, there's no emulation of 32-bits, the processor runs 32-bit code, it just needs to be told by the OS that this particular code is 32-bit and that it should run it as such!

This topic is closed to new replies.

Advertisement