Porting code to gcc, replacement for SFR?
Fri Nov 7 09:19:00 GMT 1997
Wouldn't something like
#define FUNKYREG (*(volatile unsigned long *) 0x12345678)
This is to define a name for a register memory mapped to 0x12345678 that
is 32 bits wide. Of course you can use short or char if you need to.
Why do you need anything more? If the target architecture requires
special instructions to access the register you can use the "asm ()"
> -----Original Message-----
> From: Roy Leonard [SMTP:firstname.lastname@example.org]
> Sent: Friday, November 07, 1997 3:55 AM
> To: James Youngman; email@example.com
> Subject: Re: Porting code to gcc, replacement for SFR?
> If I understand "The Explicit reg vars" correctly, this allows you to
> 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
> register. Is this correct? If this allows you to specify a memory
> 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: <firstname.lastname@example.org>
> "Never Attribute to Malice that which can be adequately explained by
More information about the crossgcc