Linking assembly and C
Hi everybody;
I have a C code and assembly (nasm) code and I am not able to find how to link them each other. Here are the codes : NASM side: Code:
global _maxofthree Code:
int maxofthree(int , int , int ); I am using ubuntu 9.10 and my NASM version 2.05.01 compiled on Nov 5 2008. Any help is greatly appreciate. |
nasm <assembly>.s -o asm.o
gcc <cfile>.c -c -o cfile.o ld cfile.o asm.o -lgcc -lc -lm -o output |
Oh and for portability sake, cmov should be replaced my a mov/jmp/cmp construct.
|
Quote:
Code:
nasm -felf32 asm_name.asm If you are running 64 bit Linux, the -m32 is needed and various 32 bit support files might need to be installed before it will work. |
Thank you everybody again. Another good reason to use Linux :) Yaşasın Linux :)
|
All times are GMT -5. The time now is 11:15 PM. |