Assembly is specific to machine architecture. IA32 (also called x86, i386) is the most popular architecture for PC.
- Register
Can be classified in 4 types:
- general purpose (eax, ebx, ecx, edx)
- pointer/index (esp, ebp, esi, edi)
- instruction pointer (eip)
- flags (eflags)
These are all 32 bits. Each register contains 8-bit and 16-bit parts. Ex: eax (32 bits), ax (16 bits), ah (8 bits), al (8bits).
- Instruction
- arithmetic/logic: add, sub, and, or,...
- control: jmp,..
- data movement: mov,..
- Operand
- register: operand value is contained in register
- immediate: operand value is a constant
- memory: operand value is in memory
- Addressing mode
Addressing mode is the way to specify a memory address.
- absolute:
address = a value
- register:
address = register content
- displacement:
address = register content + a value
- indexed:
address = register content + a value + another register content (index) * another value (scale)
- Subroutine
- subroutine is a set of instructions
- parameters passed to subroutine are usually pushed on stack
No comments:
Post a Comment