|
|
|
|
|
by ofalkaed
262 days ago
|
|
I don't think any single person did, they just went with what ever way best suited the hardware/language it is being implemented on/with and the needs of the language being implemented. If stack underflows are rare than growing down means testing for an overflow is always the same regardless of stack size and I assume this is why some languages (like Forth) have -1 as false instead of 0, -1 is an overflow so the languages own true/false can test for an overflow. In languages which are not so directly dealing with the stack, underflows are rare and may not even be possible so having the last element of the stack as stack pointer==0 simplifies things. |
|