delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/08/26/08:31:02

From: cbramix AT libero DOT it (Carlo)
Newsgroups: comp.os.msdos.djgpp
Subject: Optimizing 8 bit variables?
Date: 26 Aug 2003 05:27:43 -0700
Organization: http://groups.google.com/
Lines: 19
Message-ID: <d2ad330a.0308260427.49b6ab37@posting.google.com>
NNTP-Posting-Host: 151.25.158.86
X-Trace: posting.google.com 1061900865 22396 127.0.0.1 (26 Aug 2003 12:27:45 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 26 Aug 2003 12:27:45 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello everyone!
I have this little problem: GCC doesn't seem to optimize very well a
piece of code I wrote with 8 bit variables.
So, I was thinking to use a local register variable.
On the documentation I read that GCC can do that:

register int *foo asm ("ebx");

But what should I do if I need to use BH or BL registers?
I tried to use BH or BL instead of ebx:

register unsigned char myvar asm ("bl");

GCC doesn't give me error messages, but it generates the same code I
got without the 'asm' keyword.

Thanks in advance.

Carlo.

- Raw text -


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