First and foremost, please understand that I’ll be writing about Intel architecture only in detail that is sufficient for getting me started in assembly language.
Three main components, or basic building blocks of a computer, that we need to know for assembly language basics are the following:
- CPU
- Memory
- I/O Devices
CPU
CPU can be visualized of four components:
- Control Unit
- Control unit is used to retrieve instructions from pipeline. It also manages storing and getting data in memory.
- Execution Unit
- As the name suggests, this part of a CPU executes instructions.
- Registers
- Registers can be thought of CPU’s ultra-fast temporary memory. These are used to store intermediate results.
- Flags
- This register can be used to indicate different events happening in the current execution and state of the processor. For example, interrupts, zero value, overflow etc.
Registers
List of registers in IA-32 architecture
- General Purpose Registers
- Segment Registers
- Flags
- EIP
- Floating Point Unit Registers
- MMX Registers
- XMM Registers
General Purpose Registers
There are eight general purpose registers. MS Excel can be handy when you want to visualize registers.
General purpose registers are of 32 bits. Note that the lower 16 bit of each register, 0 to 15 bit, can be addressed separately. Moreover, from lower half of each general purpose register, 0 to 7 bits and 8 to bits can be addressed individually. For example, EAX is 32 bit. Lower half of EAX can be addressed as AX. AX can be further divided in two equal parts AH and AL (L for lower bits and H for higher bits).
Some other interesting points about IA-32 architecture to keep in mind:
- MMX registers are part of FPU registers (lower 64 bits)
- XMM registers are 128 bits in size.