Chinese description:
The essence of the literal pool is a memory block in the ARM assembly language code section that is used to store constant data rather than executable code.
English description:
Literal pools are areas of constant data in a code section.
(From ARM official document "ARM Compiler armcc User Guide")
2) Reasons for using literal pool
When you want to use a 4-byte constant data in an instruction (this data can be a memory address or a numeric constant)
Since the ARM instruction set is fixed-length (ARM instruction 4 bytes or Thumb instruction 2 bytes), it is impossible to convert this 4-byte
The constant data is encoded in a compiled instruction. At this time, the ARM compiler (compiles the C source program)/assembler (compiles the assembly program)
A block of memory will be allocated in the code section and the 4-byte data constant will be saved there. Then, an instruction will be used to store the 4-byte data constant.
Byte numeric constants are loaded into registers for operation.
In C source code, the allocation of literal pools is arranged by the compiler at compile time. When designing assembly programs, developers can
The literal pool is allocated by the developer. If the developer does not arrange the literal pool, the assembler will do it for you.
3) Practical examples:
Figure 1 is a specific example of the compiler automatically allocating a literal pool when compiling a C function.
figure 1
4) Alternatives to literal pools
The literal pool is not necessary. FIG. 2 is a specific example of using MOVW and MOVT to replace the literal pool.
figure 2
5) Principles for using the text pool
In most cases, using a literal pool can improve program performance, but in certain cases, using a literal pool (that is, using a literal pool) can improve program performance.
The most ideal alternative is
Previous article:ARM assembly programming (example)
Next article:Entry-level ARM assembly instructions
- Popular Resources
- Popular amplifiers
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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- ST official statement: STM8 and STM32 production capacity description
- Practical Tips
- Are Gallium Arsenide (GaAs) technology solid-state power amplifiers important? Let's discuss its development trend.
- NUCLEO_G431RB review——by bigbat
- Sell Tektronix oscilloscope tds3052B tds3054B tds3064B
- Unboxing ESP32-S2-Kaluga && Laser PM2.5 Sensor
- SD NAND and STM32 series successful experience sharing
- BK3432 BK3431Q Bluetooth ble chip Bluetooth smart lock application
- When the wifi module is not soldered, it will keep printing errors
- EAC0945 wince6.0 BSP compilation manual