delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/15/16:17:01

From: Ian Chapman <ichapman AT nortelnetworks DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: use of .equ in as
Date: Mon, 15 May 2000 13:18:34 -0400
Organization: Nortel
Lines: 27
Message-ID: <3920316A.40A934F6@nortelnetworks.com>
References: <g_PT4.726$EO1 DOT 1536090 AT nnrp6 DOT proxad DOT net>
NNTP-Posting-Host: bcarib90.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.72 [en] (Win95; U)
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

Well from the look of it you should have defined $2 somwhere before main
or in the braces.  It  does not know what $2 is nor do I.  In any case
main should be type int not void.  "int main()"

		Regards Ian.

Alexandre Devaure wrote:
> 
> Hi,
> I want to use .equ directive but I use it badly.
> Can you help me ?
> void main()
> {
>   asm(".equ HELLO, $2\n\t"
>       "movb HELLO,%ah");
> }
> 
> bash-2.03$ gcc -g asm.c
> asm.c: In function `main':
> asm.c:12: warning: return type of `main' is not `int'
> /tmp/ccsR72r4.o: In function `main':
> /home/devaure/tst/asm.c:13: undefined reference to `$2'
> collect2: ld returned 1 exit status
> 
> Why does it think $2 is a ref and not a number?
> 
> Alex

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019