Skip to main content
gamedev.net
🔒 Locked

External ASM libraries

Started by jim bob Nov 18, 2001 at 3:23 PM 2 replies 250+ views
Original Post
jim bob
jim bob
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!
I am not worthy of a sig! ;)
Oluseyi
Oluseyi
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).
Oluseyi
Oluseyi

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.