DragonFly BSD
DragonFly users List (threaded) for 2005-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Best register usage

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Sep 2005 09:07:40 -0700 (PDT)

:A couple of questions...
:first, I understand that BSD is C based, so system calls are expected to
:respect (and preserve) esi, edi, and ebx.
:second, I understand that the string instructions work on esi and edi.
:Aside from that, what reasons are there for choosing one register over another
:for indirect addressing?  Is there compelling reason to keep addresses in esi
:and/or edi?  What about calls?  Is it better to 'call' a subroutine from a
:particular register, other than preservation of ebx/esi/edi?

    It no longer matters.  The x86 architecture has 8 registers
    (eax,ebx,ecx,edx,esi,edi,ebp,esp) and except for esp they are all
    treated pretty much the same once the instruction has been decoded by
    the cpu.  Certain instructions, of course, still use implied (fixed)
    registers that cannot be changed, like the loop and string instructions.

					Matthew Dillon 

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]