I was reading over this question and wondered if the accepted answer might also be a way to determine the architecture. For instance, in asm could I push a WORD onto the stack and then check SP. Compare the new SP to the old SP:
Diff of 4 means 32 bit
Diff of 8 means 64 bit
Am I correct in this thinking?
Click Start, type system in the search box, and then click System Information in the Programs list. When System Summary is selected in the navigation pane, the operating system is displayed as follows: For a 64-bit version operating system: X64-based PC appears for the System Type under Item.
There is a program called uname installed on Linux that can show us if the Linux system is 32 or 64 bit. If it says x86_64, you are using a 64 bit installation. If it says i368, you are using a 32 bit installation. Uname -i gives you the hardware-platform.
A 32-bit processor on x86 architecture has 32-bit registers, while 64-bit processors have 64-bit registers. Thus, x64 allows the CPU to store more data and access it faster. The register width also determines the amount of memory a computer can utilize. Introduced in 1978.
No, because the size of your stack is based on what mode you are running in (real, protected, long/64, vm86, smm, etc), not on the architecture. If your assembly is running in protected mode for instance, your stack will be 32 bits (or 16 if your operands are 16 bits), even if your processor is x86-64.
Like someone in the comments mentioned, CPUID is the only reliable way to tell what your architecture is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With