|
-
Sep 9th, 2005, 09:33 AM
#8
Hyperactive Member
Re: ax, bx, cx, and dx registers.
 Originally Posted by Jacob Roman
Other than the fact that I can use eax for arithmetic for speed, or specific registers for things such as LOOP, I can pretty much use whatever register I want, and it wouldn't make much of a difference?
There is 8 general data regsiters on a 32 bit x86 computer.
eax, ebx, ecx, edx, esi, edi, ebp, esp
That last one ESP (Stack Pointer) is one that you can only use freely if you have MMX enabled. Other wise you cannot backup the stack pointer and you're program would crash.
The last thing that is important to know is on a windows system only EAX, ECX, and EDX are useable without being saved first. That means as far as windows is concerned, when it calls you're function it expects that the values it had in ebx, esi, edi, ebp, and esi will remain there. So push them first and pop them when you're finished (with the exception of esp, use mmx to save and restore it).
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|