At 01:43 PM 9/6/2001 -0700, Brent Dax wrote:
>Dan Sugalski:
># At 12:04 PM 9/6/2001 -0700, Brent Dax wrote:
># >In the more general case, however (say, $x*1+$x*2+...$x*65) that's an
># >interesting question.  Could we just do some fun stuff with
># lists?  What
># >do real CPUs do?
>#
># Real CPUs don't do lists. It's just one big addressable byte array...
>
>Those were two separate questions.  :^)  First, I thought that we could
>generalize the P0 case to all similar cases.  Then, I thought "Hey, this
>has to happen on real CPUs all the time.  How do they handle it?"  See?
>Two separate ideas.

Ah. Well, on real CPUs, generally parameters go in registers with overflows 
on the stack. (Assuming you have registers, of course) Most of the time you 
won't see functions called with more than two or three parameters. Seven is 
wildly unusual.

As for generating the list, that's all compiler/programmer dependent. 
Generally data's static, so you'd load in the value from $x to a register, 
then do math and push the results on the stack or into registers, then make 
the call.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to