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]

Re: Porting code to gcc, replacement for SFR?


>>>>> "Roy" == Roy Leonard <rleonard@trintech.com> writes:

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

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