in reply to Re^5: Help me to understand increment / decrement operator behavior in perl
in thread Help me to understand increment / decrement operator behavior in perl
How about machine without registers?
After a couple of hours of looking, beyond the like of purely theoretical entities, like the nicely named, but non-existent PERL-a registerless architecture, I can find no indication that a register-less CPU does, has, or ever will exist.
But assuming, just for a moment, that such a thing did exist, why would it put arguments on a "stack", when it effectively has unlimited registers in the form of the entire address space to work with?
And, how would it implement a "stack", without a 'stack pointer'?
And what benefit would there be to transferring a value from one memory address (the variable) to another memory address (a stack slot) in order to compare it against a value located at another memory address (whether the variable's address, or that of some location on the stack)?
How about values retrieved early in the sub and compared late in the sub?
"retrieved" from where? The variable's (named) location? Ie. a memory address -- which conventionally would already be some place on the stack for local variables.
If the sub has access to it, it must know its address. What would be the point in moving it from that address, to another address (on the stack) at an early point in the code, before comparing it later in the code?
|
---|