Originally Posted by
[implicit]
The registers store data in active memory. It's not really important you know how they work. But they are faster (require less clock cycles) to use than accessing data from somewhere in memory (variables).
They can all be used for basically anything, with the exception of EIP which points to the next instruction. However, some instructions use specific registers so to optimize you want to make sure you use the right register:
eax - most commonly used for everything. WinAPI functions return with eax, mul, div use eax, etc.
ebx - general data use (can't think of any specific instructions)
ecx - counter, loop uses it
edx - again, general data, but things like mul and div that cannot be only stored in eax will overflow into edx so you can use it as a 64 bit number eax:edx
esi - string source, used in string operations, points to input string
edi - string destination, used in string operations, points to outputted string
esp - stack pointer, points to the top of the stack (access things on the stack)
ebp - base pointer, points to the base of the stack (useful in procedures to access local variables)