www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/28/16:25:59

Date: Wed, 29 Jan 1997 10:19:30 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: local labels in in-line assembler?
To: Paul Lay <play AT nortel DOT co DOT uk>
Cc: djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <32EF2432.4DB2@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <32EDD76A DOT 41C67EA6 AT nortel DOT co DOT uk>

Paul Lay wrote:
> 
> Is it possible to use local labels from in-line assembler
> in a C function?
> 
> I've tried using "L<x>" labels, which would be local if I
> were writing straight assembler, but compiling my C program
> gives label already defined errors where I've used the same
> "L<x>" label in different functions.

Those are the wrong sort of local labes. You use '0' to '9' (giving 10
local labels in each direction)
eg

0: jmp 0f   jumps v
1: jmp 2f   jumps v one line
2: jmp 3f   jumps v
  ...
0: jmp 0b   jumps ^
1: jmp 2b   jumps ^
2: jmp 1b   jumps ^ one line
3: ...

Bill
-- 
Leave others their otherness.

- Raw text -


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