Stack register

Stack register

A stack register is a computer central processor register whose purpose is to keep track of a call stack. On an accumulator-based architecture machine, this may be a dedicated register such as SP on an Intel x86 machine. On a general register machine, it may be a register which is reserved by convention, such as on the PDP-11 or RISC machines. Some designs such as the Data 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 and HP 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 a call stack, the other(s) keep track of other stack(s).

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Stack buffer overflow — In software, a stack buffer overflow occurs when a program writes to a memory address on the program s call stack outside of the intended data structure; usually a fixed length buffer.cite web last = Fithen first = William L coauthors = Seacord,… …   Wikipedia

  • Register Stack Engine — Die Register Stack Engine (RSE) ist ein programmiertechnischer Mechanismus zur effizienten Handhabung des Stapelspeichers (Stack) bei der IA 64, der Intel Architektur für 64 Bit Prozessoren. Die Parameter einer Funktion werden in Registern… …   Deutsch Wikipedia

  • Stack machine — In computer science, a stack machine is a model of computation in which the computer s memory takes the form of one or more stacks. The term also refers to an actual computer implementing or simulating the idealized stack machine.In addition, a… …   Wikipedia

  • Stack (data structure) — In computer science, a stack is an abstract data type and data structure based on the principle of Last In First Out (LIFO) . Stacks are used extensively at every level of a modern computer system. For example, a modern PC uses stacks at the… …   Wikipedia

  • Register (Computer) — Als Register bezeichnet man in der Digital oder Computertechnik Speicherbereiche, die innerhalb eines Prozessors direkt mit der eigentlichen Recheneinheit verbunden sind und die unmittelbaren Operanden und Ergebnisse aller Berechnungen aufnehmen …   Deutsch Wikipedia

  • Register file — A register file is an array of processor registers in a central processing unit (CPU). Modern integrated circuit based register files are usually implemented by way of fast static RAMs with multiple ports. Such RAMs are distinguished by having… …   Wikipedia

  • Stack Pointer — Vereinfachte Darstellung eines Stacks mit den Funktionen Push (drauflegen) und Pop (runternehmen) In der Informatik bezeichnet ein Stapelspeicher oder Kellerspeicher (kurz Stapel oder Keller, häufig auch mit dem englischen Wort Stack bezeichnet)… …   Deutsch Wikipedia

  • Register machine — In mathematical logic and theoretical computer science a register machine is a generic class of abstract machines used in a manner similar to a Turing machine. All the models are Turing equivalent. Contents 1 Overview 2 Formal definition 3 …   Wikipedia

  • Register allocation — In compiler optimization, register allocation is the process of multiplexing a large number of target program variables onto a small number of CPU registers. The goal is to keep as many operands as possible in registers to maximise the execution… …   Wikipedia

  • stack — stacker, n. stackless, adj. /stak/, n. 1. a more or less orderly pile or heap: a precariously balanced stack of books; a neat stack of papers. 2. a large, usually conical, circular, or rectangular pile of hay, straw, or the like. 3. Often, stacks …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”