This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Porting the GCC to 8051-Microcontroller ? Register Banks


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


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