www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/19/15:30:40

Xref: news2.mv.net comp.os.msdos.djgpp:7639
Newsgroups: comp.os.msdos.djgpp
From: hk AT bercos DOT de (Helge Kruse)
Subject: Re: inline assembler question
Sender: usenet AT bercos DOT de
Organization: Bercos GmbH
Message-ID: <DwDoJE.4ts@bercos.de>
References: <ACQmFGAuPiEyEwQy AT demon DOT co DOT uk>
Date: Mon, 19 Aug 1996 15:25:54 GMT
Lines: 35
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Orco <mar AT demon DOT co DOT uk> wrote:
>Just wondering how I would go about creating a self modifying label name
>in DJGPP.. for example in MASM I could create a MACRO :-
>
>        xxx MACRO x, y, z
>                LOCAL label1
>
>                ......
>                label1:
>        ENDM
>
>How would I go about doing the same thing in DJGPP??

#define xxx(x,y,z) \
1:

That's all, but if you want to use the local label, you should reference it
with a trailing f or b:

#define xxx(x,y,z) 		\
	mov	x,%eax		\
	or	%eax,%eax	\
	mov	y,%eax		\
	jz	1f		\
	mov	z,%eax		\
1:

But beware of long macros! I found that gas cuts very long lines without
a warning.




	Helge

- Raw text -


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