| PLEX86 | ||
Where should the type information be 128
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... Where should the type information be 131 Nick Maclaren Yes. Some (one and a half). Certainly nowhere near all. What have I done to suggest I would be that stupid? ALL of them? Do you... 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 EVERYTHING, not just preserving info across call boundaries. Perhaps some illustrative code might make things clearer. Where should the type information be 132 Trevor L. Jackson, III deletes that reliance If every file requires at least one datum block, there is an upper bound on the size of the directory (i-node space, in... HLL code A = (B * C) + (D + E) Traditional register code Load Register 1, B Load Register 2, C Multiply Register 3, Register1, Register2 Load Register 1, D Load Register 2, E Multiply Register4, Register1, Register2 Add Register 3, Register3, Register4 Store Register3,A Stack oriented code Push B Push C Multiply Push D Push E Multiply Add Pop A Note that in the stack code, there are NO register numbers. All calculations are done on the stack. This has advantages and disadvantages. BTW, the maximum stack depth for this code is three. snip Yes. That is the traditional way of handling stacks on a register machine. On a stack machine, the stack is the primary thing and there are no registers to "go through". All things, even those that you did in registers - such as arithmetic - are done on the stack using stack oriented instructions. Thank you. 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 multiply is an abstract to me because no print...
Yup. Precisely! But wouldn't PDP-10 code look closer to the first fragment I wrote above than the second? You could compute the results of the statement I used to illustrate the difference directly on your HP calculator. In fact, the key strokes would be pretty much as I wrote - just subsbreastute "enter" for "push". But you could't do that on a "traditional" calculator unless you either had a place ("a memory " AKA register) to store the results of the first multiply, or had a calculator that supported parentheses ( which make use of the memory behind your back).
You don't need to put the whole array onto the stack at once. Only the elements on which you are operating at the moment. In practice, a depth of a handfull is sufficient for most applications. You could always pop to memory as "scratch" storage. -- - Stephen Fuld e-mail address disguised to prevent spam
|
||||
Where should the type information be 129 Alt Folklore Computers from Newsgroups The #1 Usenet Provider on the Internet
|
||||