Porting code to gcc, replacement for SFR?

Roy Leonard rleonard@trintech.com
Fri Nov 7 03:55:00 GMT 1997

If I understand "The Explicit reg vars" correctly, this allows you to access
the internal registers which are addressed by name in assembler, eg. r1.  If
I understand this correctly, it doesn't allow you to specify a memory mapped
register.  Is this correct? If this allows you to specify a memory mapped
register, how do I implement it?



>  Roy> The code makes use of an IAR specific type called sfr - special function
>  Roy> register.  Does anyone know of a similar type in gcc, or an easy way to
>  Roy> implement a similar type?
>  Roy> A special function register is something like a UART control
register, which
>  Roy> is at a predetermined address and can read/written to as a byte or as
>  Roy> individual bits.
>GCC allows you to specify for a variable what machine register it
>should live in,  I expect that that will do what you want.  The
>relevant technique is explained in the GCC documentation.   The info
>nnode you want is titled "Explicit Reg Vars".
Roy Leonard
Trintech Manufacturing Ltd
Tel: +353 1 295 6766
Fax: +353 1 295 4735
aka: <leonardr@iol.ie>
"Never Attribute to Malice that which can be adequately explained by stupidity!"

More information about the crossgcc mailing list