This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Porting the GCC to 8051-Microcontroller ? Register Banks
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: Porting the GCC to 8051-Microcontroller ? Register Banks
- From: Richard Hadsell <hadsell at blueskystudios dot com>
- Date: Wed, 22 Dec 1999 17:23:16 -0500
- CC: "Anja [M_ller]" <Mueller-Lehnitz at t-online dot de>, gcc at gcc dot gnu dot org
- Organization: Blue Sky Studios
- References: <199912222104.VAA14397@phal.cygnus.co.uk>
Joern Rennecke wrote:
>
> I think your best bet is to ignore the existence of the register banks
> in the compiler.
FYI, in case you or Anja didn't know: Some old computers (PDP-11,
Motorola 68000, I forget which) selected register banks with a couple of
bits in the program status register. These were intended to switch
context between user, supervisor, and kernel states. The kernel state
would be loaded when there was some kind of interrupt, so that the
interrupt handler could use registers right away without saving the
user's registers.
Anyway, I would not expect a compiler to try to access the registers in
one of the other banks. Special code in the operating system might have
to save or restore them in order to dispatch a new context, but (if I
recall correctly) there were special machine instructions for accessing
registers of different banks. Otherwise, most code, including operating
system code, would expect to be dealing only with its assigned
registers.
So, I agree with your suggestion of treating the general registers as
just a single set, unless Anja plans to use the compiler to create code
for switching contexts.
--
Dick Hadsell 914-381-8400 x5446 Fax: 914-381-9790
Reply-to: hadsell@blueskystudios.com
Blue Sky Studios http://www.blueskystudios.com
1 South Road, Harrison, NY 10528