On Mon, 2002-11-04 at 15:32, Scott Courtney wrote: > growing memory structure in the entire system. Really. Ask anyone who did > embedded systems work back then. You avoided dynamic memory structures if > you could because the programming and debugging tools were primitive and > because often the applications were simple enough not to need them. And > because dynamic memory structures needed to be managed by the application > or at least the compiler runtime, and that took CPU cycles. With a clock > speed of around 2 megahertz, and cycle times measured in microseconds, > this mattered a lot.
Or any games programmer for 8bit micros. When I then moved to a real computer (Honeywell L66) and learned B the malloc/free thing was actually quite a revalation. > So they came up with the downward-growing stack. Put the stack pointer > initially at one address above the top of memory, because PUSH and POP used > predecrement/postincrement logic. If you were lucky enough to have a full > load of 64K of memory, you could set the SP to 0x0000 so that its first > byte stored would wrap around to 0xffff, the top of RAM. In any case, init > the SP at power up, don't use the top few words of RAM, and basically forget > about the stack. They had lots of prior art to draw from, Subroutines go back to at least 1947, and subroutine call/return stacks to about 1952. By mid 1960 the burroughs machines had a fairly conventional stack.
