Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

Assembly

Table of Contents

Syntaxes

  • There are 2 types of assembly language syntax in common use:

Intel

ATT

Registers

  • Registers are small, fast storage areas on the CPU
  • In IA-32 architecture, there are 10 32-bit registers and 6 16-bit registers
  • Registers are grouped into 3 categories: general-purpose, control, and segment
    • general-purpose is further grouped into data, index, and pointer

General-Purpose Registers

Data Registers

  %eax: Accumulator, often used for arithmetic and return values.
  %ebx: Base register, used for extra storage.
  %ecx: Counter, often used in loops.
  %edx: Data register, often used for I/O operations.

Index registers

  %esi/%edi: Source and destination for data operations.

Pointer Registers

    %eip: stores the offset address of the next instruction to be executed. 
    %esp: Stack Pointer, points to the top of the stack.
    %ebp: Base Pointer, used for stack frame management.

Control Registers

Segment Registers