Mail Archives: djgpp/2001/01/05/13:36:50
From: | pixelpajas AT my-deja DOT com
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Nasm & Gcc. HELP!
|
Date: | Fri, 05 Jan 2001 18:11:49 GMT
|
Organization: | Deja.com
|
Lines: | 84
|
Message-ID: | <9352ot$tpb$1@nnrp1.deja.com>
|
References: | <934tdg$oj0$1 AT nnrp1 DOT deja DOT com> <934uk4$po1$1 AT nnrp1 DOT deja DOT com>
|
NNTP-Posting-Host: | 194.236.50.233
|
X-Article-Creation-Date: | Fri Jan 05 18:11:49 2001 GMT
|
X-Http-User-Agent: | Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
|
X-Http-Proxy: | 1.1 x65.deja.com:80 (Squid/1.1.22) for client 194.236.50.233
|
X-MyDeja-Info: | XMYDJUIDpixelpajas
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
In article <934uk4$po1$1 AT nnrp1 DOT deja DOT com>,
Tom St Denis <stdenis AT compmore DOT net> wrote:
> In article <934tdg$oj0$1 AT nnrp1 DOT deja DOT com>,
> pixelpajas AT my-deja DOT com wrote:
> >
> >
> > Hi .. I'm trying to learn how to use nasm
> > assembler code with gcc but i get an error when i
> > link the objects. Below are the source files and
> > command compile/link entries.
> >
> > - 4k.c ----------------------------------------
> >
> > extern unsigned int keyget(unsigned int);
> >
> > void main(void)
> > {
> > keyget(1);
> > }
> >
> > -----------------------------------------------
> >
> > - lib.asm -------------------------------------
> >
> > [BITS 32]
> > [GLOBAL _key]
> > [SECTION .text]
> >
> > _key: MOV CX,1
> >
> > keyloop: MOV AH,01h
> > INT 16h
> >
> > JZ keyloop
> > MOV AH,00h
> > INT 16h
> >
> > MOV AH,0Ah
> > INT 10h
> >
> > CMP AL,0Dh
> > JNE keyloop
> >
> > MOV AH,4Ch // clean exit
> > INT 21h // ----------
> >
> > -----------------------------------------------
> >
> > first i build lib.asm -> nasm -f coff lib.asm
> >
> > then i compile 4k.c -> gxx -nostdlib -nostdinc -
> > fno-builtin -fno-exceptions -c -O3 4k.c -r
> >
> > and at last i try to link -> ld -nostdlib -
> > nostdinc -fno-builtin -fno-exceptions -e _main -
> > oformat binary -o 4k.com 4k.o lib.o
> >
> > but in the last step i get -> " 4k.o
> > (.text+0x6):4k.c: undefined reference to `_keyget
> > (unsigned int)' "
> >
> > Is there anyone out there that can help me and
> > tell me what im doing wrong???
>
> My only suggsetion is to put the "global" declaration inside your
> section .ie
>
> [section .text]
> [global _keyget]
> ...
>
> perhaps?
>
> Tom
------------>
nope.. did not make any difference..
thanx anyways..
/iman
Sent via Deja.com
http://www.deja.com/
- Raw text -