Hello everyone,
I have a question I'd like to ask. A few days ago, I started a course on assembly programming language for 32-bit Intel processors (x86 architecture, I think), because I'm interested in low-level details of how a computer operates. The problem is, as I have just found out, the CPU of my laptop has a 64-bit instruction set (it's an Intel Mobile Core 2 Duo T6570 processor, http://ark.intel.com/products/42841/Intel-Core2-Duo-Processor-T6570-(2M-Cache-2_10-GHz-800-MHz-FSB) ). Also, I would like to add that I have NASM intalled and I'm using a 32-bit version of Windows 7.
My question: will 32 bit assembly instructions work here, or having a 32-bit operating system will be enough?
If not, can anybody suggest a good tutorial that will eventually work with my CPU?
Thanks in advance.
Posted on 2012-06-09 10:47:33 by Kirill De Vries
Short answer: Yes.

Longer (yet simplistic) answer: Your processor supports 64-bit Long Mode, but that is just one of the operating modes. If you are running 32-bit Windows 7, then your CPU is already running in 32-bit Protected Mode.

Longer (yet complex) answer: Read up on the x86 operating modes including sub-modes such as compatibility mode which is the basis for WoW64, file formats such as MZ and PE, x86 instruction set operand and address overrides, etc. In short, there is much that goes into backwards compatibility, both at the hardware and software layers.
Posted on 2012-06-09 13:02:14 by SpooK
Some more background info (yes x86 is a huge mess, and it takes a lot of explaining... you have more than 30 years of history to catch up on).

x86 is an incremental platform, with full backward compatibility.
So every CPU that supports the x86-64 mode, will also support the i386 mode (32-bit), and every CPU that supports i386 mode also supports the classic x86 modes (16-bit 8086 realmode and 286 protected mode).

64-bit versions of Windows also support 32-bit Windows applications. However, they no longer support 16-bit modes (except for virtual machines, eg the XP-mode in Windows 7, or installing a 16-bit compatible OS inside VirtualPC, VMWare or VirtualBox). 32-bit versions of Windows support 32-bit and 16-bit modes.
Linux never had a 16-bit mode at all, but afaik most 64-bit versions of linux will also support 32-bit.
Posted on 2012-06-09 13:19:59 by Scali
... and for a tutorial...
http://www.drpaulcarter.com/pcasm/

This is a "portable" tutorial - hides some C library routines behind some macros to access various OSen. When you get ready for Windows-specific stuff, Iczelion's tutorials...

Best,
Frank

Posted on 2012-06-09 14:50:34 by fbkotler
Thanks for your replies.Both helpful and informative.
Posted on 2012-06-10 07:19:55 by Kirill De Vries