R
Ruben.Colina
i'm trying to make a program c which use a function in assembler, can
anybody help me, i'm using linux with gcc-4.1 and nasm 0.98.38:
i have three files:
a.c
a.h
espera.asm
each files contains the following:
-------------------------------------------------
//espera.asm
global _espera
_espera:
mov ah, 0x00
int 0x16
ret
--------------------------------------------------
//a.c
#include "ruben.h"
int main(void)
{
espera();
return 0;
}
----------------------------------------------------
//a.h
extern void espera(void);
to compile the .asm with nasm i use:
$ nasm -f aout espera.asm -o espera.o
to compile .c file i use:
$gcc -c a.c
to link the files generated i use:
$ ld -o programa espera.o a.o
and it's return the following error:
what is my error, what am doing bad?, please help me
thanks for all!
note: perdon my english i know that is very bad.
anybody help me, i'm using linux with gcc-4.1 and nasm 0.98.38:
i have three files:
a.c
a.h
espera.asm
each files contains the following:
-------------------------------------------------
//espera.asm
global _espera
_espera:
mov ah, 0x00
int 0x16
ret
--------------------------------------------------
//a.c
#include "ruben.h"
int main(void)
{
espera();
return 0;
}
----------------------------------------------------
//a.h
extern void espera(void);
to compile the .asm with nasm i use:
$ nasm -f aout espera.asm -o espera.o
to compile .c file i use:
$gcc -c a.c
to link the files generated i use:
$ ld -o programa espera.o a.o
and it's return the following error:
ld: aviso: no se puede encontrar el símbolo de entrada _start; usando por >defecto 0000000008048098
a.o: In function `main':
a.c.text+0x12): referencia a `espera' sin definir
what is my error, what am doing bad?, please help me
thanks for all!
note: perdon my english i know that is very bad.