64-bit registers under 32-bit windows

前端 未结 1 509
悲&欢浪女
悲&欢浪女 2021-01-08 00:35

I just installed mingw32 on my 32-bit Vista box to experiment with gcc inline assembly. Unfortunately the 32-bit gcc compiler does not recognize the 64-bit registers, such a

1条回答
  •  旧巷少年郎
    2021-01-08 00:48

    1. Yes, a 64-bit processor has 3 size modes, 16-bit, 32-bit and 64-bit. An operating system cannot run code in a mode larger than the operating system itself. Thus Vista 32-bit can only run code built for 16-bits and 32-bits. Your processor does indeed support 64-bits, so you should try to install a 64-bit OS on it. If your computer came with actual windows Vista CDs, there may be a separate CD for Vista 64. If you build a new toolchain with x86-64 support you will be able to compile code that uses 64-bit instructions and registers, but you will not be able to run the resulting executables unless you install a 64-bit OS.

    2. Since rax is a 64-bit register (the 32-bit equivalent is eax) it cannot be accessed except from a 64-bit program. The reason for this is a rather convoluted explanation of how the processor interprets the commands your program sends.

    But, you don't actually need access to 64-bit code in order to use MMX, SSE, SSE2, and SSE3. All of those instructions are available in 32-bit mode and are supported by your processor.

    You also might want to consider running a Virtual Machine and putting Ubuntu inside it. This will allow you to run Linux inside a window on your Windows desktop. I think you will have a easier time of things using the GNU tool chain (gcc, etc) natively than you will using mingw32. VMs are easy to install and use in this day and age, there's little reason to use mingw32 anymore. You could also look in to MS Visual C++ Express, which a windows-based compiler that is free from Microsoft, but it doesn't support 64-bit (you have to pay for a version that does).

    0 讨论(0)
提交回复
热议问题