- Stack register
A stack register is a computer central
processor register whose purpose is to keep track of acall stack . On anaccumulator-based architecture machine, this may be a dedicated register such as SP on anIntel x86 machine. On a general register machine, it may be a register which is reserved by convention, such as on thePDP-11 orRISC machines. Some designs such as theData General Eclipse had no dedicated register, but used a reserved hardware memory address for this function.Machines before the late 1960s—such as the
PDP-8 andHP 2100 —did not have compilers which supported recursion. Their subroutine instructions typically would save the current location in the jump address, and then set the program counter to the "next" address. [cite book
author = David Salomon
title = Assemblers and Loaders
month = February
year = 1993
publisher = Ellis Horwood Ltd
isbn = 0130525642
url = http://www.davidsalomon.name/assem.advertis/asl.pdf
accessdate = 2008-10-01
quote = Most computers save the return address in either the stack, in one of the registers, or in the first word of the procedure (in which case the first executable instruction of the procedure should be stored in the second word). If the latter method is used, a return from the procedure is a jump to the memory location whose address is contained in the first word of the procedure.] While this is simpler than maintaining a stack, since there is only one return location per subroutine code section, there cannot be recursion without considerable effort on the part of the programmer.A
stack machine has 2 or more stack registers — one of them keeps track of acall stack , the other(s) keep track of other stack(s).References
Wikimedia Foundation. 2010.