What is the stack register?

In relation to computers, the register of the magazine is a memory location - usually on the central processing unit (CPU) or related processing hardware - which holds the current address of the upper part of the separate computer memory known as the magazine. The reservoir register is important, because without it the computer would have to implement slower and more susceptible to errors monitoring of the program. In most system architectures, the register of the stack is a reserved register, so it is not accidentally accessible when working with other memory registers. Rarely, it can be a register of the magazine by a general register, which is usually accessible by the program, but is intentionally not used because its use is defined by the manufacturer. When the computer system contains two or more magazines, which means there is a potentially more than one magazine, the architecture is known as the machine for the magazine.

at the lowest computer programming level is a memory-based magazine in the memory of random access (RAM) -Která has a well-defined type of behavior. The magazine may have added information to it in a process called pushing, or it can have information obtained from it called cracking. The magazine model is first -class, last, which means that if a few information is pushed into the magazine, then the first element pushed will be the last one that will be jumped, while the last element pushed will be the first to load with a pop command. The tank register monitors the top of the tank, which is always the last item pushed into it.

6 If the program calls a subroutine - or procedure, function or method, depending on the programming language and mpomlčka; Then the program must skip to the subroutine code memory address to make it. The address where the control flow of the program breaks down on the branch into the subroutine is pushed on the magazine, so it is remembered. When subroutines complete the execution, the program knows where it should return to the main code, by lining the code address from the top of the tank, where the stack register is directed.

Although there are other methods that can be used to achieve the same results, the use of the magazine and the register of the magazine allows an important concept of programming known as recursion. A recursive function is a function that is called within its own code. This process is commonly used in sorting algorithms and for certain mathematical functions. The magazine register monitors all the latest addresses where the execution is branched, so that the function can safely implement recruitment knowing that the control will eventually return to the point of origin. One complicates finding, if the entire magazine becomes full and no room in memory remains, in which case the magazine will overflow, the program will stop.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?