views:

62

answers:

4

I have a laptop with an intel i3 processor running windows 7 64-bit.

I am wondering, can I set up a VM running, say, windows XP 32-bit, and be able to code targeting the intel 32 architecture? will my code compile, run, debug, the same way it would on a native 32bit machine?

thanks!

A: 

If you cross-compile it in the 64bit OS then yes it will run in the 32bit OS just fine, you could also simply compile it in the 32bit OS and that would work too.

Seadog
+1  A: 

If the processor isn't buggy, and the WoW64 layer is working correctly, then your 32-bit code will work pretty much the same on your 64-bit OS. No need for a VM.

Anon.
I will note here that I am assuming you have an x86-64 processor, not an Itanium - the WoW64 layer on Itanium pretty much *is* a VM, and emulates the x86 instruction set, while WoW64 on an x86-64 processor just switches the processor to x86 mode whenever it's time to run a 32-bit thread.
Anon.
A: 

If you open your project's configuration manager you can compile for a target of Win32 or x64, regardless of which OS you're using for Visual Studio. If you didn't select the necessary compilers when you installed Visual Studio or an SDK, you'll have to install them now.

As a separate issue, whatever OS you install in a VM, when you run in that VM you're running in that OS. You can install multiple OSes into a single VM too, one OS per partition in your virtual disk drive(s), the same as on a real PC.

Windows programmer
A: 

The 64 bit instruction set used in i7, Core 2 etc, is not IA64, its called AMD64, or x86-64. IA64 is used in Itanium server processors. As for the answer, you don't need to specifically set a VM to run/code/compile 32 bit apps. You can do that on 64 bit machine too. All this can be done just as you would on a 64 bit machine by checking the appropriate options in VS.