Home >Common Problem >What does stack mean?
The stack is a specific storage area or register that has a fixed end and a floating end. The data stored in this storage area is a special data structure. A stack is a data structure in which data items are arranged in order, and data items can only be inserted and deleted at one end (called the top of the stack).
In the computer field, the stack is a concept that cannot be ignored. The stack is a data structure. A stack is a data structure in which data items are arranged in order. Data items can only be inserted and deleted at one end (called the top of the stack).
In microcontroller applications, the stack is a special storage area. Its main function is to temporarily store data and addresses. It is usually used to protect breakpoints and scenes.
The stack is a specific storage area or register that has a fixed end and a floating end. The data stored in this storage area is a special data structure.
All data can be stored or taken out only at one end of the float (called the top of the stack). Access is strictly in accordance with the principle of "first in, last out". The elements in the middle must be in The elements in the upper part of the stack (the ones that are pushed into the stack last) can only be taken out after they are removed one by one. Opening up an area in the internal memory (random access memory) as a stack is called a software stack; a stack composed of registers is called a hardware stack.
In microcontroller applications, the stack is a special storage area. The stack is part of the RAM space. The stack is used to save and restore on-site data during function calls and interrupt switching.
The objects in the stack have a characteristic: the first object put into the stack is always taken out last. This characteristic is usually called first-in-last-out (FILO—First-In/Last-Out). There are a number of operations defined on the stack, the two most important being PUSH and POP. PUSH operation: Increase the stack pointer (SP) by 1, and then add an element to the top of the stack. The POP (pop) operation is the opposite. When popping out of the stack, the contents of the internal ram unit indicated by SP are first sent to the unit addressed by the direct address (destination location), and then the stack pointer (SP) is decremented by 1. These two operations implement the insertion and deletion of data items.
For more related knowledge, please visit PHP Chinese website! !
The above is the detailed content of What does stack mean?. For more information, please follow other related articles on the PHP Chinese website!