W
Walter Roberson
David R Brooks said:Moving to mini & micros, they all grow the stack downward:
*all* ?? That's a pretty big territory to cover!
I assume
because most of the early ones (8086 being the exception) booted code
from zero, so there was usually ROM at low addresses. So grow the stack
toward it.
However, there's a case to be made for growing it upward, namely that
buffer overflows cannot mess with the saved register image or other
important areas: an overflow will only trash that function's own data,
then walk into unallocated space. Might make things a lot more robust.
The buffer being overflowed could be one whose address came from
the calling routine.