vertex78
January 17th, 2009, 04:07 PM
Hello, I am going through Paul Carter's assembly tutorial and I am having troubles compiling the first example. There error message I get is:
example1.o: file not recognized: File format not recognized
collet2: ld returned 1 exit status
Here is my c code and my assembly code.
#include <stdio.h>
int main(){
asm_main();
return 0;
}
segement .data
segment .bss
segment .text
global _asm_main
_asm_main:
enter 0,0
pusha
popa
mov eax,0
leave
ret
To compile I did:
nasm -f coff example1.asm
gcc -o example1.o main.c
I am using linux and gcc version 4.3.2
example1.o: file not recognized: File format not recognized
collet2: ld returned 1 exit status
Here is my c code and my assembly code.
#include <stdio.h>
int main(){
asm_main();
return 0;
}
segement .data
segment .bss
segment .text
global _asm_main
_asm_main:
enter 0,0
pusha
popa
mov eax,0
leave
ret
To compile I did:
nasm -f coff example1.asm
gcc -o example1.o main.c
I am using linux and gcc version 4.3.2