1. IF, ELSE, ENDIF
Syntax format:
IF logical expression
Instruction sequence 1
ELSE
Instruction sequence 2
ENDIF
The IF, ELSE, and ENDIF pseudo-instructions can determine whether to execute a certain instruction sequence based on whether a condition is met.
If the expression is true, execute instruction sequence 1, otherwise execute instruction sequence 2. Among them, ELSE and instruction sequence 2 can be absent. In this case, when
If the logical expression following IF is true, instruction sequence 1 is executed, otherwise the following instructions are continued to be executed.
IF, ELSE, and ENDIF directives can be nested.
Example of use:
GBLL Test; declare a global logic variable named Test...
IF Test = TRUE
Instruction sequence 1
ELSE
Instruction sequence 2
ENDIF
2. WHILE, WEND
Syntax format:
WHILE logical expression
Instruction sequence
WEND
The WHILE and WEND pseudo-instructions can determine whether to loop and execute a certain instruction sequence based on whether a condition is met.
If the expression is true, the instruction sequence is executed. After the instruction sequence is executed, the value of the logical expression is judged. If it is true, the execution continues.
The logical expression evaluates to false.
WHILE and WEND directives can be nested.
Example of use:
GBLA Counter; declare a global math variable named Counter
Counter SETA 3; The number of loops is controlled by the variable Counter
…
WHILE Counter < 10
Instruction sequence
WEND
3. MACRO, MEND
Syntax format:
$label macro name$parameter 1, $parameter 2, ...
Instruction sequence
MEND
MACRO and MEND pseudo instructions can define a section of code as a whole, called a macro instruction, and then you can use macro instructions in the program.
Call this code multiple times. The $ symbol will be replaced by a user-defined symbol when the macro is expanded. The macro can be used
One or more parameters that are replaced by their values when the macro is expanded.
The usage and function of macro instructions are similar to those of subroutines. Subroutines can provide modular programming, save storage space and improve
However, when using the subroutine structure, the scene needs to be protected, which increases the system overhead. Therefore, when the code is short and needs to be passed
When there are many parameters, macro instructions can be used instead of subroutines.
The instruction sequence between MACRO and MEND is called the macro definition body. The first line of the macro definition body should declare the prototype of the macro (including the macro
The instruction sequence can then be called in the assembler by the macro name. When the source program is compiled, the assembler will
Call expansion replaces the macro call in the program with the instruction sequence in the macro definition and passes the value of the actual parameter to the formal parameter in the macro definition.
MACRO and MEND directives can be nested.
4. MEXIT
Syntax format:
MEXIT
MEXIT is used to jump out of a macro definition.
Previous article:Introduction to ARM assembly pseudo-instructions Part 2
Next article:SDRAM driver for S3C2440
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- 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
MoreDaily News
- 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
Guess you like
- Function overloading and reentrancy
- Alternative winners in the 5G era
- What Jack Ma said about starting a business...
- Phytec's IMX8Mplus review
- Transplantation of webplayer audio player based on RVB2601
- MCU serial communication program help
- When the TL5708 development board does not have a router, connect the PC and the development board with a network cable and place them in the same network segment to transfer files between them.
- [Mil MYC-JX8MPQ Review] + Improve the sht20 reading on the QT side
- What does DIN VDE V 0884-11:2017-01 mean for digital isolator certification?
- Do CAN and LIN in automotive BCM and ECU need to be isolated? Do switching quantities need to be isolated? How to design grounding?