A lot of x86-Assembly programs with their counterpart in C/C++
General-purpose registers (GPRs) can store both data and addresses, i.e., they are combined data/address registers; in some architectures, the register file is unified so that the GPRs can store floating-point numbers as well.
Wikipedia
Register | Common Use |
---|---|
EAX | Accumulator |
EBX | Memory pointer, base register |
ECX | Loop control an counters |
EDX | Interger multiplication and division |
ESI | String instruction source pointer and index register |
EDI | String instruction destination pointer and index register |
ESP | Stack pointer |
EBP | Stack frame pointer |
Type | Example | Equal to |
---|---|---|
Immediate | mov eax,45 | eax = 45 |
imul ebx, 12h | ebx *= 0x12 | |
xor dl, 44h | ebx *= 0x44 | |
add esi,8 | esi ^= 8 | |
Register | mov eax, ebx | eax = ebx |
inc ecx | ecx += 1 | |
add ebx,esi | ebx += esi | |
mul ebx | edx:eax = eax * ebx | |
Memory | mov eax,[ebx] | eax= *ebx |
add eax,[val] | eax += *val | |
or ecx,[ebx+esi] | ecx | |
sub word ptr [edi],12 | * (short*) edit -=12 |