Understanding of the ARM stack

Publisher:binggegeLatest update time:2015-11-17 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The stack is actually a continuous space in the memory, but it is special because of the stack pointer. The stack is generally divided into two types:
Growing upward: The stack pointer grows toward higher addresses, which is called an increasing stack.
Growing downward: The stack pointer grows toward lower addresses, which is called a descending stack.
For a stack, the end where insertion or deletion can be performed is called the top of the stack, and the other end is called the bottom of the stack. Since the stack only allows operations at one end, it operates on the principle of last in, first out. The stack pointer points to the last valid data item pushed into the stack.
Why do we say "grow upward or grow downward"? This is a matter of habit. Generally, when drawing a stack diagram, it is customary to draw the low address at the bottom and the high address at the top, as shown in the following figure:
                            Understanding of the ARM stack
In ARM, although both types of stacks are supported, general program compilers only support one type, that is, growing from top to bottom, satisfying the full-decreasing method (the stack grows downward by reducing the address of the memory, and the stack pointer points to the lowest address containing valid data items), so instructions such as LDMFD and STMFD are generally used.
Keywords:ARM Reference address:Understanding of the ARM stack

Previous article:Analysis of LDM and STM instructions in ARM
Next article:ARM keywords for declaring functions

Latest Microcontroller Articles
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
    Since development under LINUX is still quite troublesome, is there a more convenient and simple development method under WINDOWS? The answer is yes. Of course, it is not a development tool like ADS, because it ...
  • Learn ARM development(15)
    When using GCC to develop ARM, you will definitely encounter compiler problems. For example, you will encounter various warnings and errors when compiling C code. For example, I encountered several warnings yesterday, so let's take a look at what these warnings are ...
  • Learn ARM development(16)
  • Learn ARM development(17)
  • Learn ARM development(18)
  • Embedded system debugging simulation tool
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号