4 stack structures and corresponding ARM instruction suffixes

Publisher:彭勇Latest update time:2022-08-02 Source: csdn Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

ARM's 8 instruction suffixes:

ia (increase after) is transmitted first, then address + 4

ib (increase before) first address +4, then transmit

da (decrease after) first transmit, then address -4

db (decrease before) first address -4, then transmit

fd (full decrease) full decrease stack

ed (empty decrease) empty decrease stack

fa (full add) full increment stack

ea (empty add) empty increment stack


For example:

stmia sp, {r0 - r12}

Store r0 into the memory pointed to by sp (assumed to be 0x30001000); then the address + 4 (that is, pointing to 0x30001004), store r1 into this address; then the address + 4 again (pointing to 0x30001008), store r2 into this address... until the content of r12 is put into (0x3001030), and the instruction is completed.


4 stack structures:

Empty stack: The stack pointer points to an empty space. Each time you store something, you can store it directly and then move the stack pointer one space. When you take something out, you need to move it one space before you can take it out.

Full stack: The stack pointer points to the last data in the stack. Each time you store data, you need to move the stack pointer one grid before storing it. When you take data out, you can take it out directly and then move the stack pointer.

Stack growth: When the stack pointer moves, the stack moves in the direction of increasing address.

Decrement stack: A stack that moves in the direction of decreasing address when the stack pointer moves


ARM has four types of stack structures:

1. Full reduction stack: push (move the pointer first and then push, the pointer moves in the direction of decreasing address); pop (pop first, the stack pointer moves to the direction of increasing address).

2. Full stack: push (move the pointer first and then push, the pointer moves in the direction of increasing address); pop (pop first, the stack pointer moves to the direction of decreasing address).

3. Empty minus stack: push (first enter the stack, the stack pointer moves in the direction of decreasing address); pop (move the pointer first and then pop, the stack pointer moves in the direction of increasing address)

4. Empty stack: push (first enter the stack, the stack pointer moves in the direction of increasing address); pop (move the pointer first and then pop, the stack pointer moves in the direction of decreasing address)

Note: You don’t need to worry about which stack structure to use when using it. As long as you use the same stack structure for pushing and popping, there will be no error.


Remark:

ARM uses full reduction stack by default

Reference address:4 stack structures and corresponding ARM instruction suffixes

Previous article:Explanation of common knowledge points of ARM pseudo-instructions
Next article:Detailed explanation of ARM's 37 registers and exception handling mechanism

Recommended ReadingLatest update time:2024-11-15 14:27

User stack and kernel stack in ARM Linux system
On Linux systems, a process has two different stacks, one is the user stack and the other is the kernel stack. User stack The user stack is the stack used directly by the application. As shown in the figure below, it is located at the top of the application's user process space. When the user program calls functio
[Microcontroller]
User stack and kernel stack in ARM Linux system
ARM9_S3C2440 Learning (VI) SDRAM Memory Allocation
SDRAM memory allocation
[Microcontroller]
arm7 Litian Electronics lpc2148 GPIO 2 single-channel LED control experiment
Note: This development board of Litian Electronics is different from Zhou Ligong's LPC2131. On Zhou Ligong's development board, you can use a jumper stick to choose whether to use the 595 driver. When Zhou Ligong conducted the GPIO output experiment - single-channel LED control experiment in his textbook, he directly
[Microcontroller]
arm7 Litian Electronics lpc2148 GPIO 2 single-channel LED control experiment
Design of electronic control throttle based on ARM-Linux
Introduction The cruise control system (CCS) was developed in the 1960s and is also known as a constant speed driving system. When the cruise control system is working, the ECU determines the vehicle's operating status based on the signals sent by various sensors, and automatically adjusts the throttle opening throug
[Microcontroller]
Design of electronic control throttle based on ARM-Linux
Use crosstool-ng to build your own ARM cross-compilation tool chain (for S3C6410 and other processors)
1. Download crosstool-ng The download address of crosstool-ng is: http://ymorin.is-a-geek.org/download/crosstool-ng/ It is worth noting that after downloading the latest crosstool-ng, remember to go to http://ymorin.is-a-geek.org/download/crosstool-ng/01-fixes/ to see if there is any corresponding patch. If
[Microcontroller]
Design of data acquisition and wireless transmission module based on ARM7
With the continuous expansion of application fields such as data monitoring, wireless communication and EDA technology, people have put forward higher requirements on the acquisition accuracy, acquisition speed and data storage capacity of data acquisition systems. In view of the shortcomings of the current data acqui
[Microcontroller]
Design of data acquisition and wireless transmission module based on ARM7
【ARM bare board】Nand Flash programming
1. Read chip ID 1.1 Read chip ID timing Simplified into 4 steps: 1. Enable chip select 2. Write command 0x90 3. Write address 0x00 4. Read ID information /* Identify NAND FLASH */ void scan_nand_flash(void) {    int i;    //Save the array of read ID information    unsigned char id_info = {0};    nand_enable_cs()
[Microcontroller]
【ARM bare board】Nand Flash programming
Design of two power supply modes in handheld terminal tester based on ARM
1 Introduction In multifunctional intelligent instruments, different power supply methods are sometimes required at different work sites. At present, in the research of power supply, redundant power supply and multiple power supply methods are the current research hotspots. Redundancy technology is relatively matur
[Microcontroller]
Design of two power supply modes in handheld terminal tester based on ARM
Latest Microcontroller Articles
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号