| delorie.com/archives/browse.cgi | search |
| Message-ID: | <368A8531.A0AA35C@gmx.net> |
| Date: | Wed, 30 Dec 1998 18:55:29 -0100 |
| From: | Robert Hoehne <robert DOT hoehne AT gmx DOT net> |
| Organization: | none provided |
| X-Mailer: | Mozilla 4.07 [de] (Win95; I) |
| MIME-Version: | 1.0 |
| To: | djgpp AT delorie DOT com |
| Subject: | Re: Can't unroll loops when using "-O" Optimation and having defined |
| labels with asm | |
| References: | <36894BAB DOT 61D18F84 AT gmx DOT de> <76csnr$8vi$1 AT latinum DOT dresearch DOT de> |
| Reply-To: | djgpp AT delorie DOT com |
Michael Beck wrote :
>
> Any better solution?
Use relative labels in assembler like:
unsigned short x;
for (x=0;x<8;x++)
{
asm("jmp 1f\n\t"
"1:\n\t");
}
or
unsigned short x;
for (x=0;x<8;x++)
{
asm("1:\n\t"
"jmp 1b\n\t");
}
Here is the labelname 1 (can be any other digit) and the
character 'f' or 'b' stand for "forward" or "backward".
Robert
--
******************************************************
* email: Robert Hoehne <robert DOT hoehne AT gmx DOT net> *
* Post: Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW: http://www.tu-chemnitz.de/~sho/rho *
******************************************************
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |