When I first learned ARM instructions, I was always confused about the full stack and the empty stack. According to the literal meaning, that is, the definition in the data structure, an empty stack is a stack with no data, and a full stack is a full stack.
But pay attention to the definition in the book:
Empty stack: When the stack pointer points to the next empty location, it is called an empty stack
Full stack: If the stack pointer always points to the last data pushed into the stack, it is called a full stack.
Therefore, the empty and full here do not indicate the storage status of the stack at all, but only indicate whether the storage unit pointed to by the stack pointer has stored stack data, or whether data can be written directly to the storage unit pointed to by the stack pointer when pushing into the stack. This is the "full stack" and "empty stack". The blogger's understanding is that empty and full only indicate the status of the unit pointed to by the pointer.
Next, let’s talk about what upward growth and downward growth mean, increasing stack and decreasing stack. Oh my, I couldn’t understand the definition at that time.
Increasing stack: growing towards higher addresses
Descending stack: grows towards lower addresses
Let me use a not very vivid picture to illustrate the teacher's classware:
Why do we say "grow upward" and "grow downward"? That's because when drawing a stack diagram, the lower address is drawn at the bottom and the higher address is drawn at the top.
OK, let's talk about the suffix problem related to it:
Index suffix (IA, IB, DA, DB) ---- used for data block transfer, the address base cannot use the SP (R13) register
First explain the meaning of the letters to facilitate memorization
I–Icrement
A—After
B-Before
D – Decrement
IA—post-increment, that is, the base address is increased by 4 after each transfer, pointing to the next word
IB—pre-increment, that is, the base address is increased by 4 before each transfer, pointing to the storage unit where the word transferred this time is located
DA—post-decrement, that is, the address is reduced by 4 after each transfer, pointing to the next word
DB—Pre-decrement, that is, the address is reduced by 4 before each transfer, pointing to the word of this transfer
Stack suffix (FD, FA, ED, EA) ---- The address base must use SP (R13), the stack must use the stack area
F—Full
D—Descending
E – Empty
A—Ascending
Let's discuss the block replication issue:
Which instruction is used depends on whether the data is stored above or below the base register, and whether the address is incremented before or after the first store.
See the following figure for the corresponding command collocation:
Let's take the STMIB STMFA in the first box as an example.
STMIB: Increment before passing (index mode)
SYMFA: Full Incrementing Stack
Previous article:ARM instruction classification (details)
Next article:22 concepts commonly used in ARM development
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- TI z-stack's OSAL multi-task scheduling mechanism
- Sensor question
- [National Technology Low Power Series N32L43x Review] 1. Development Board Unboxing
- TIOBE Index for July 2021
- MOS tube smokes directly
- How to solve the motor efficiency and temperature rise problems caused by motor controllers
- Getting Started with the MSP432P401R Clock
- Fudan Micro MCU product introduction and selection table
- Three-phase Vienna topology technology detailed introduction
- [TI millimeter wave radar evaluation] IWR1443BOOST unboxing test