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

Register conventions in FreeBSD assembler


From: Jonathon McKitrick <jcm@xxxxxxxxxxxxxxxxx>
Date: Thu, 25 Aug 2005 14:33:33 +0100

Hi all,

I'm doing some fun encryption stuff with assembler, and I was wondering if
there are any register usage conventions I should be aware of.  Here's what I
have so far.

These are pretty obvious:

1.  The return value of EAX is the C function return value.
2.  ECX is often used as a counter.
3.  ESI/EDI are used as source/destination for array/string operations.

But I'm looking for less obvious stuff that might be important, like these
I found:

1.  EBX is expected to be unchanged over C function calls.
2.  ESI/EDI are also expected to be unchanged over C calls.

Are there any others I should be aware of?

jm
-- 



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