visual studio 2008 target machine type list

384 views Asked by At

I found I can select target machine under project properties. There is a large list:

MachineX86 (/MACHINE:X86)
MachineAM33 (/MACHINE:AM33)
MachineARM (/MACHINE:ARM)
MachineEBC (/MACHINE:EBC)
MachineIA64 (/MACHINE:IA64)
MachineM32R (/MACHINE:M32R)
MachineMIPS (/MACHINE:MIPS)
MachineMIPS16 (/MACHINE:MIPS16)
MachineMIPSFPU (/MACHINE:MIPSFPU)
MachineMIPSFPU16 (/MACHINE:MIPSFPU16)
MachineMIPSR41XX (/MACHINE:MIPSR41XX)
MachineSH3 (/MACHINE:SH3)
MachineSH3DSP (/MACHINE:SH3DSP)
MachineSH4 (/MACHINE:SH4)
MachineSH5 (/MACHINE:SH5)
MachineTHUMB (/MACHINE:THUMB)
MachineX64 (/MACHINE:X64)

I have the following questions:

  1. What is the meaning of that acronym?
  2. Required hardware?
  3. Required software and/or operating system?
  4. It is possible to build binaries on x86 system? If yes, how to configure Visual Studio 2008 Express?
  5. Does any change must be made in code if it compiles fine for x86, x64, itanium?
2

There are 2 answers

0
Danra On

This setting is for configuring what CPU architecture to compile your source code for. Depending on the architecture you choose, you'll get a different binary.

A binary compiled for a specific CPU architecture has a structure that, after loaded into memory, the CPU can understand. There's, for example, commands for the CPU to execute, and data to load.

Whether or not the same source code can be compiled for different architectures depends on what you're doing. You'll usually be OK, but it's easy to break cross-compatibility by doing data-size sensitive stuff, manipulating memory directly, depending on architecture-specific features, etc.

Also, it's easy to write code which depends on features available in a specific OS. This isn't directly related to this setting, but of course if you're calling e.g. a Windows API that's only available on the PC and trying to compile for ARM, it won't work - There won't be any library compiled for ARM which defines that function to link with.

0
pi314159 On

As an answer for question 1.
You can find the list of conventional machine type acronyms in this book: "The Common Language Infrastructure Annotated Standard", by James S. Miller, Susann Ragsdale, p.738.

+------------------------------+---------+------------------------------------------------+
| IMAGE_FILE_MACHINE_AM33      |  0x1d3  |  Matsushita AM33                               |
| IMAGE_FILE_MACHINE_AMD64     |  0x8664 |  AMD AMD64                                     |
| IMAGE_FILE_MACHINE_ARM       |  0x1c0  |  ARM, little endian                            |
| IMAGE_FILE_MACHINE_CEE       |  0xc0ee |  clr pure MSIL (object only)                   |
| IMAGE_FILE_MACHINE_EBC       |  0xebc  |  EFI Byte Code                                 |
| IMAGE_FILE_MACHINE_I386      |  0x14c  |  Intel 386 or later, and compatible processors |
| IMAGE_FILE_MACHINE_IA64      |  0x200  |  Intel IA64                                    |
| IMAGE_FILE_MACHINE_M32R      |  0x9041 |  Mitsubishi M32R, little endian                |
| IMAGE_FILE_MACHINE_MIPS16    |  0x266  |                                                |
| IMAGE_FILE_MACHINE_MIPSFPU   |  0x366  |  MIPS with FPU                                 |
| IMAGE_FILE_MACHINE_MIPSFPU16 |  0x466  |  MIPS16 with FPU                               |
| IMAGE_FILE_MACHINE_POWERPC   |  0x1f0  |  Power PC, little endian                       |
| IMAGE_FILE_MACHINE_POWERPCFP |  0x1f1  |  Power PC with floating point support          |
| IMAGE_FILE_MACHINE_R4000     |  0x166  |  MIPS, little endian                           |
| IMAGE_FILE_MACHINE_SH3       |  0x1a2  |  Hitachi SH3                                   |
| IMAGE_FILE_MACHINE_SH3DSP    |  0x1a3  |  Hitachi SH3 DSP                               |
| IMAGE_FILE_MACHINE_SH4       |  0x1a6  |  Hitachi SH4                                   |
| IMAGE_FILE_MACHINE_SH5       |  0x1a8  |  Hitachi SH5                                   |
| IMAGE_FILE_MACHINE_THUMB     |  0x1c2  |  Thumb                                         |
| IMAGE_FILE_MACHINE_WCEMIPSV2 |  0x169  |  MIPS WCE v2, little endian                    |
+------------------------------+---------+------------------------------------------------+

Note the difference in namings:

 1. IMAGE_FILE_MACHINE_AMD64  ->  MachineX64
 2. IMAGE_FILE_MACHINE_I386   ->  MachineX86

Not sure about "MachineMIPSR41XX" from your list though