huseyinyagli
Programmer
Program is running normally do the job but is killed at the end and I get this error message
a very simple example:
---asm.s
global OpenFile
section .text
OpenFile:
push ebp
mov ebp,esp
mov eax,5
mov ebx,[ebp+8]
mov ecx,0
int 80h
leave
ret
--------main.c
extern int OpenFile(const char *);
int main(int argc,char *argv[]){
int result = 0;
if(argc > 1)
result = OpenFile(argv[1]);
printf("%d\n",result);
return 1;
}
----makefile
try : main.o asm.o
gcc -o try main.o asm.o
main.o : main.c
gcc -c main.c
asm.o : asm.s
nasm -f elf asm.s
a very simple example:
---asm.s
global OpenFile
section .text
OpenFile:
push ebp
mov ebp,esp
mov eax,5
mov ebx,[ebp+8]
mov ecx,0
int 80h
leave
ret
--------main.c
extern int OpenFile(const char *);
int main(int argc,char *argv[]){
int result = 0;
if(argc > 1)
result = OpenFile(argv[1]);
printf("%d\n",result);
return 1;
}
----makefile
try : main.o asm.o
gcc -o try main.o asm.o
main.o : main.c
gcc -c main.c
asm.o : asm.s
nasm -f elf asm.s