From: Joey Lloyd Newsgroups: comp.os.msdos.djgpp Subject: Compile C with ASM --- Help me. Date: Fri, 11 Jun 1999 15:11:06 -0400 Organization: Georgia Institute of Technology, Atlanta GA, USA Lines: 106 Message-ID: <37615F49.290D9E29@me.gatech.edu> NNTP-Posting-Host: jlloyd.gtri.gatech.edu Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------6B1110CA55486B7D7CA03A33" X-Trace: news-int.gatech.edu 929128264 13309 130.207.208.22 (11 Jun 1999 19:11:04 GMT) X-Complaints-To: usenet AT news DOT gatech DOT edu NNTP-Posting-Date: 11 Jun 1999 19:11:04 GMT X-Mailer: Mozilla 4.08 [en] (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com --------------6B1110CA55486B7D7CA03A33 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Below is a copy of an assembly and a C file that i am trying to combine. I am using NASM to assemble the .ASM file and GCC to compile/make/link these files. When I run GCC i get the following error message: undefined reference to 'getvmode(void)' What am I doing wrong? --------------------- Filename: gvm.asm ------------------- ------- Assembled using: nasm gvm.asm -fcoff -ogvm.o ------ global _getvmode section .text _getvmode: mov ah,0x0f ;get video mode int 0x10 ;call BIOS ret ;Current video mode in AL ---------------------------------------------------------- --------------------- Filename: j.cc --------------------- ------- Compiled using: gcc j.cc gvm.o -o j.exe ---------- #include extern int getvmode(); int main() { int i; i=getvmode(); printf("Video Mode: %d\n",i); } ---------------------------------------------------------- Thanks. Joey Lloyd jolloyd AT bellsouth DOT net --------------6B1110CA55486B7D7CA03A33 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Below is a copy of an assembly and a C file that i am
trying to combine.  I am using NASM to assemble the
.ASM file and GCC to compile/make/link these files.
When I run GCC i get the following error message:

undefined reference to 'getvmode(void)'

What am I doing wrong?
 

--------------------- Filename: gvm.asm -------------------
------- Assembled using: nasm gvm.asm -fcoff -ogvm.o ------

                global _getvmode

                section .text

_getvmode:      mov ah,0x0f     ;get video mode
                int 0x10        ;call BIOS
                ret             ;Current video mode in AL

----------------------------------------------------------
 

--------------------- Filename: j.cc ---------------------
------- Compiled using: gcc j.cc gvm.o -o j.exe ----------
 

#include <stdio.h>

extern int getvmode();

int main()
{
        int i;

        i=getvmode();

        printf("Video Mode: %d\n",i);
}
 

----------------------------------------------------------

Thanks.

Joey Lloyd
jolloyd AT bellsouth DOT net
 
  --------------6B1110CA55486B7D7CA03A33--