Mail Archives: djgpp/1998/08/03/23:00:30
I FORGOT TO WRITE SOMETHING
SCROLL DOWN PLZ...
>I'm writing a program in DJGPP and an Assembler (NASM 0.97)
>When I link the object-files from DJGPP and NASM, and I run the
>program, I get the message :
> "Exiting due to signal SIGSEGV"
>
>This is my code :
>in test.c:
>
> #include <stdio.h>
> extern void hi_there ();
>
> int main ()
> {
> hi_there ();
> return 0;
> }
>
>
>int testasm.asm:
>
> SEGMENT _TEXT USE32
> extern _printf
> global _hi_there
>
> _hi_there:
> push ebp
> push dword Message
> call _printf
> add esp, 4
> pop ebp
> ret
SEGMENT _DATA USE32
Message db "Hi there!!!", 13, 10, 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I forgot to write this...
> At the dos command-line :
> nasm testasm.asm -o testasm.o -f coff
> gcc test.c testasm.o -o test.exe
>
>Who can help me?
>
>Sylvester Hesp
>hes3 AT gironet DOT nl
>
>
- Raw text -