Porting code to gcc, replacement for SFR?

Roy Leonard rleonard@trintech.com
Wed Nov 5 09:09:00 GMT 1997


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




More information about the crossgcc mailing list