CPU Registers and their functionality

Registers are the internal memory locations which are used as variables.  Using registers instead of memory to store values makes the process faster. Very broadly there are four types of Registers they are General purpose registers, index registers, segment registers, pointer registers, and indicator register.

General purpose registers:

EAX, EBX, ECX, EDX.

Index registers:

ESI, EDI.

Segment registers:

CS, DS, ES, FS, GS, SS.

Pointer registers:

EIP, ESP, EBP.

Indicator register:

EFLAGS.

Functions of some Registers:

Register             Function

EAX                 Stores the return value.

EBX                  Base pointer for memory access.

ECX                  Counter for loop counter and strings.

EDX                 io pointer and arithmetic.

ESI                   source pointer for string operations

EDI                   Destination pointer for string operations

EIP                   Points to next instruction address to be executed.

ESP                  Stack pointer

EBP                 Base pointer and holds the base address of the stack.