4 ms·
Sorry I meants "Can you give me an example of an address to a stack pointer where you are allowed to make recursive calls"?
by heavenlyblue 4y ago
Sorry I meants "Can you give me an example of an address to a stack pointer where you are allowed to make recursive calls"?
- Taniwha 4y agoI'm not quite sure what you mean - the Burroughs machines have full sets of display registers (hardware managed pointers to each of the stack frames that were currently in scope - Algol/etc had more complex scoping that modern C-style languages) - a stack pointer contained a lexical level (an index into the display registers) and an offset into that stack frame - there's a variant that's 'stuffed' (essentially a reference to a variable in a stack frame that's out of scope - based on the base of stack) I think it's important to understand that it's not a C machine, doesn't have a linear address space in the normal sense This is worth reading to understand more: https://people.eecs.berkeley.edu/~kubitron/courses/cs252-F00/handouts/papers/burroughs.pdf https://people.eecs.berkeley.edu/~kubitron/courses/cs252-F00...
- heavenlyblue 4y ago> Addresses were not plain numbers; they were more like Unix paths, as in /program/function/variable/arrayindex. How do I address a variable within a function that was recursed into twice?
- Taniwha 4y agoyou create an in-scope reference within the function - and then 'stuff' it which converts it into an offset from the base of the stack - converts an "indirect reference word" into a "stuffed indirect reference word"
- Taniwha 4y agoit's what you use to pass by reference ..... but algol supports pass-by-name semantics (of which pass by reference is an optimisable subset) - to do fill pass by name (for a simple example a[i] where i is a global) the compiler will create a thunk (a tiny subroutine, in scope of the place where the parameter was passed) and pass a pointer to it - the tag of '7' means a PCW - when it gets dereferenced as a pointer the hardware does a subroutine call to the thunk in the correct scope