For example, to link DJGPP and NASM you need:
Set up DJGPP:set djgpp=c:\djgpp\DJGPP.ENVset path=%path%;c:\djgpp\bin
A C file:
#include <stdio.h>


int main(void)
{
 return 0;
}


An ASM file:bits 32


;Things from NASM are declared global:
;;
 global _call0



;Things from DJGPP are declared extern:
;;
 extern _printf




_call0:
ret



A BAT file for building:nasm asm.asm -f coff -o asm.o
gcc asm.o c.c -o exe.exe







   ----- Forwarded Message ----- From: Knedlik <kned...@trainmazeland.com>To: 
"freedos-devel@lists.sourceforge.net" 
<freedos-devel@lists.sourceforge.net>Sent: Thursday, January 12, 2023 at 
01:45:18 PM CSTSubject: [Freedos-devel] Linking asm with C
 Hello,
I’m currently trying to make a function in a separate assembly file, but I’m 
having problems linking it with a C program. Are there any guides that show how 
to do this?
Thanks in advance,
-Knedlik

_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel
  
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to