Where should the type information be 126
I don't understand that sentence. Remember, we are talking stack oriented architecture here, not PDP-10. Think of the HP calculators (the ones they advertise as being "without equals")
Where should the type information be 130
On Sat, 26 Mar 2005 16:52:32 GMT, "Stephen Fuld" Nit. That will work on an HP-48, but on an HP-35, the result will be a stack...
Agreed. Or at least a fragment of one.
OK. But the code fragment above was just the part of the code that did the subscript calculation and resultant access for an element of the three dimensional array I used as an example in a previous post. In higher level language terms, think of it as the right hand side of the statement
X = Array(x,y,z)
Where should the type information be 127
one. I'm now dropping it down to 98% after reading your explanation. :-)) Although the PDP-10 had registers, the PUSHing and...
Nope. Again, you are thinking about a "register machine". I am not good enough to write the stack primitives for your example, but it would be something that computed the subscripts-memory address for the element of B, then pushed that element of B onto the stack, then computed the subscript-memory address for the desired element of C, then pushed that element onto the stack, then multiplied the two top elements on the stack to complete the RHS of the equation. Then do the computations to get the address of A into with to do the store, and pop the stack to that address. Each of the subscript-address calculations I mentioned would be similar to the pseudo code above, but abbreviated (since your example had 2 D arrays but the pseudo code above was the a 3 D array). Only one stack is needed. You just have to get used to the idea of ordering the calculations so the element you want is at the top of the stack when you need it. So in your example above, with the code I outlined, the value of the element of B will sit on the stack throughout the calculation of the address for C and the push of C onto the stack precisely so that it will be right below that C element - perfectly set up for the needed multiply! It is a different way of thinking.
Where should the type information be 128
snip But a true stack machine doesn't have registers (as Peter points out - at least from a programmer's point of view) at all and uses the stack for...
Where should the type information be 129
Herein lies a big gap of something missing. The something missing is my lack of knowledge about how wires are wired. This...
I don't think so. Remember, this is a stack oriented architecture, not a register oriented one like the PDP-10. There isn't really a "register set". Everything is done "on the stack".
-- - Stephen Fuld e-mail address disguised to prevent spam