From: Adnan Khaleel Newsgroups: comp.os.msdos.djgpp Subject: Help with Assembly - Date: Sun, 10 Jan 1999 21:37:45 -0600 Organization: Texas A&M University, College Station, Texas Lines: 54 Message-ID: <36997209.B16493B@ee.tamu.edu> NNTP-Posting-Host: modem-0665.rns.tamu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Date: 11 Jan 1999 03:38:47 GMT X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi there, I'm porting a program from UNIX over to dos and I'm using the good old DJGPP for it (what else!). I have one problem that I cant figure out. One of the files of the source code is written entirely in assembly and has several routines and is contained in a file with a .s extention. All the files i.e. all the *.c and this *.s file are compiled into object files and then into a library. Later this library in called during linking the usual. Everything compiles fine even the .s file but when I link it later on, I get errors saying that there is an undefined reference to the functions in the .s file. I've done exactly the same think in UNIX and I've never encountered these errors. Here is a sample from that .s file just in case. .file "subs.s" .text .globl _restore _restore: movl _spp,%esp movl _fpp,%ebp movl _xlen,%ebx movl _xto,%esi movl _xfrom,%edi jmp .L1 .L0: movl %esi,%eax movl %edi,%edx movl (%edx),%ecx movl %ecx,(%eax) addl $4,%esi addl $4,%edi .L1: movl %ebx,%eax decl %ebx testl %eax,%eax jg .L0 movl (%esp),%ebx movl 4(%esp),%esi movl 8(%esp),%edi leave ret where _spp, _fpp .... are global variables. Its in the standard AT&T syntax so thats not the problem. Any help or pointers appreciated. Adnan