Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!amdahl!drivax!alexande From: alexande@drivax.UUCP Newsgroups: comp.os.minix Subject: Stack Growth Direction Message-ID: <913@drivax.UUCP> Date: Mon, 9-Feb-87 19:12:09 EST Article-I.D.: drivax.913 Posted: Mon Feb 9 19:12:09 1987 Date-Received: Thu, 12-Feb-87 18:44:49 EST References: <383@dayton.UUCP> <13647@ti-csl.CSNET> <384@dayton.UUCP> Reply-To: alexande@drivax.UUCP (Mark Alexander) Organization: Kludges 'R' Us, Inc. Lines: 30 Keywords: Stacks Summary: RTFM In article <384@dayton.UUCP> joe@dayton.UUCP (Joseph P. Larson) writes: >Pre-decrement of SP for a push makes the stack grow up... Wrong. I quote from the Intel iAPX 286 Programmer's Reference Manual, 1984, pages B-80 and B-84: POP ... The word on the top of iAPX 286 stack, addressed by SS:SP, replaces the previous contents of the memory, register, or segment register operand. The stack pointer SP is incremented by 2 to point to the new top of stack. PUSH ... The stack pointer SP is decremented by 2, and the operand is placed on the new top of stack, which is pointed to by SS:SP. Then, from the Motorola M68000 Programmer's Reference Manual, 4th ed., page 23: Stack growth from high to low memory is implemented with -(An) to push data on the stack, (An)+ to pull data from the stack. That's straight from the equine oral orifice. As the bumper sticker says (in another context), "Read The Book." -- Mark Alexander ...{hplabs,ucbvax!decvax}!decwrl!pyramid!amdahl!drivax!alexande "This then is my story. I have reread it. It has bits of marrow sticking to it, and blood, an