Archived

This topic is now archived and is closed to further replies.

jim bob

External ASM libraries

Recommended Posts

Hello. I have decided to go back to DJGPP for my OS programming, along with NASM. I dislike its form of inline assembly, so could I use NASM to write assembly routines, and link them with the C program, by simply calling a function or something? If so, how can you do this? Any resources? Thanks. I am not worthy of a sig!

Share this post


Link to post
Share on other sites
Both C and assembly produce - or should I say are capable of producing - the same form of intermediate/object files (compiled code). Combining them into an executable is simply a case of linking them, but the linker must be able to find symbol names and resolve all externals. Look up "C name mangling" and "ASM name mangling" so you can figure out the proper way to name your procedures in both languages and how to call them.

I seem to remember Rick Booth covering this briefly in Inner Loops (good book on Assembly optimizations; recommended reading).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Dont listen to Oluseyi, he doesn''t know what the hell he is talking about---*gasp* idiot = Oluseyi

Share this post


Link to post
Share on other sites