home .. forth .. misc mail list archive ..

Re: Hobbit again (and function arguments)


At 11:52 AM 3/25/96 GMT, Andrew Haley <aph@atml.co.uk> wrote:
>RISC instructions are often a bit less dense than CISC.

Often more than a factor of two.

>RISC processors handle procedures with a variable number of
>arguments perfectly correctly.

You seem to be right. I just didn't see how it could be done.
(And apparently no-one else on this list knew. ;-)

I have checked it on a DEC Alpha:
The first six arguments are put in registers. If there are more, they
are put on the stack in memory.
When the compiler notices during the translation of the called function
that it takes the address of any of the arguments (or local variables?)
it reserves space on the stack and still stores all the registers in memory.
Just in front of the other arguments. This is possible because RISC
processors keep the return address (and the old frame-pointer?)
that would normally be in the way, in registers (as we all probably
know). They can be stored elsewhere on the stack when necessary.
 
>Yes, but the 68000 is a completely broken CISC architecture.  Alpha is
>a much better example...

It's very nice indeed. ;-)

Groeten,
Jaap

-- Chip Directory
-- http://www.hitex.com/chipdir/ - USA
-- http://www.xs4all.nl/~ganswijk/chipdir/ - Europe
-- Many other international mirror sites from there...