Common assembly instructions
1. General registers and program counter in ARM state
(1) Registers used by each working mode in ARM state
(2) Current Program Status Register (CPSR)
N: Whether the result is a negative number
Z: Whether the operation result is 0
C: Carry/borrow/shift overflow
V: Overflow flag (Overflow)
I: Interrupt disable bit
F: Fast interrupt disable bit
T: CPU status bit; when set, the CPU is in Thumb state; otherwise, it is in ARM state.
M4~M0: working mode bits
Interrupt disable bit: I bit and F bit belong to interrupt disable bit. When they are set, IRQ interrupt and FIQ interrupt are disabled respectively.
2. The representation format of ARM instructions in the machine is represented by 32-bit binary numbers.
There is an instruction in ARM: ADDEQS R0,R1,#8;
ARM instructions are divided into 5 domains:
The first field: the 4-bit [31:28] condition code field. There are 16 combinations of 4-bit condition codes.
The second field: instruction code field [27:20], in addition to the instruction code, also contains several very important instruction features and the encoding of the optional suffix.
The third field: address base Rn, is 4 bits [19:16], encoding 16 registers from R0 to R15.
The fourth field: the target or source register Rd, is 4 bits [15:12], encoding 16 registers from R0 to R15.
The fifth field: address offset or operation register, operand area [11:0].
The 5 fields of the above instruction are 0000 0010 1001 0001 0000 0000 0000 1000, and the hexadecimal code is 0291008H. The function of the instruction is to add R1 and 8 and put the result into R0.
3. Branch instruction (jump):
One is to use a branch instruction; the other is to directly write the target address value to the program counter PC (R15).
By writing the jump address value to the program counter PC, any jump in the 4GB address space can be realized. Before the jump, the future return address value can be saved by combining the use of "MOV LR, PC" and other similar instructions, thereby realizing subroutine calls in the 4GB continuous linear address space;
When using branch instructions, the jump space is limited.
Assembly instruction format:
The content in <> in the format is essential, and the content in { } can be omitted. { {S} determines whether the execution result of the instruction affects the value of CPSR. If this suffix is used, the result of the instruction execution affects the value of CPSR, otherwise it does not. {,
Previous article:Root file system construction (JZ2440-S3C2440)
Next article:GPIO - Light up an LED (JZ2440-S3C2440)
- 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
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- Why do new boards still include serial ports?
- What good things did everyone buy on Double 11? I bought a pair of "quantum long johns"
- Microsoft's Unbounded Mouse software
- Regarding the LDO operating temperature rise expression, heat generation power and efficiency calculation.
- Share a set of Qinheng MCU CH559/CH554/CH552 and other USB application example source code
- IMX6 development board running and debugging HelloWorld on the simulator
- 【GD32307E-START】+A/D data acquisition and sensor
- [TI Recommended Course] #Wide Input DC/DC Converter to Meet Low Quiescent Current Requirements in Industrial Applications#
- Single Voltage Reference vs. Dual Voltage Reference - III
- How to prevent excessive current when controlling multiple uln2003-driven stepper motors?