Search code examples
gccoperating-system32-bitprocessor

Simulating 32 bit processor register - Compiler enough or 32 bit OS required?


I have an assignment to make some assembly code that I am supposed to run on a intel processor with a 32 bit register. The problem is that I don't have a 32 bit processor.

My question: I am wondering if compiling as 32-bit application with -m32 in gcc is enough to simulate 32-bit processor register? Or do I need to install a 32 bit OS to properly simulate a 32 bit processor register?


Solution

  • It depends on what you mean by "simulate a 32 bit register" a 64 bit register "simulates" a 32 bit register if you ignore the upper 32 bits.