This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Porting code to gcc, replacement for SFR?



Hi,

We have a lot of legacy code which was written for the IAR compiler (v3.31)
for the Hitachi H8/3002. I am hoping to port some of this code over to the
GCC compiler.

The code makes use of an IAR specific type called sfr - special function
register.  Does anyone know of a similar type in gcc, or an easy way to
implement a similar type?

A special function register is something like a UART control register, which
is at a predetermined address and can read/written to as a byte or as
individual bits.

Example:

sfr UART_CONTROL = 0xff20;   /* The address of UART_CONTROL */

UART_CONTROL = 0xff   /* set the contents of the register to 0xff */

UART_CONTROL.1 = 0;   /* set bit 1 to 0 */

Any ideas, comments....

Cheers,

Roy 

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!"