Stephen Montgomery-Smith wrote:
[ ... ]
> In the mean time, can anyone tell me or point to me documentation
> telling me any kind of rules that assembler functions called from C
> programs have to obey? (And maybe vice versa.)

Whether a given chunk of code was orignally written in assembler or in C doesn't
matter, since C programs usually get translated into assembly by the compiler.
Regardless of the origin, the code needs to follow the calling conventions of
the platform, as well as the interfaces defined by the C header files; see a
K&R, or "man elf" and the references from there:

     Hewlett Packard, Elf-64 Object File Format.

     Santa Cruz Operation, System V Application Binary Interface.

     Unix System Laboratories, "Object Files", Executable and Linking Format
     (ELF).

In practice, compiling a small program in C and taking a look at the
corresponding assembly via "cc -S" will probably be fairly helpful as well.

-Chuck


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message

Reply via email to