Special instructions in inline assembler

Derek Roberts derek@camroberts.org.uk
Tue Dec 16 16:59:00 GMT 2003


Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de> wrote:

 > You can declare two fixed registers with something like
 >
 > register uint32_t r2 asm("r2");
 > register uint32_t r3 asm("r3");
 >
 > and use them. Of course this will not be as efficient as if the
 > compiler were to chose them itself, but at least you need no copying.

Falk,

Thanks so much for your suggestion.  I think this is sufficiently useful 
that someone ought to add it to one of the inline assembler FAQ's.  Several 
other GCC hackers I asked hadn't seen this way of nailing down the registers.

Best,
Derek Roberts


More information about the Gcc-help mailing list