Nineth Chapter Advanced Assembly Language Technology
- Macro compilation
- Repeating assembly
- Conditional compilation
Macro compilation
Macro and Macro Directives macro definition, macro invocation, Macro expansion macro definition parameters local pseudo action using macro list in macro definition establishment and invocation of purge pseudo-action macro library
Macro: Macro is a feature of assembly language, it is similar to the subroutine and unique another way to simplify the source program
is a program code with independent function in the source program. Once defined, it can be called multiple times .
Macro directives: user-defined directives . When programming, the function of multiple calls is replaced by a macro.
Macro definition
Format: macro directive name macros [dumb meta table]
......
...... ; Macro definition Body
Endm
1) Macro directive name: The name of the macro definition that is invoked with the macro directive name to invoke the macro definition. The first symbol of a name must be a letter.
2) Dummy table: The parameters used in the macro definition. Separated by commas for each dummy element
3) macro definition body: A set of program code with independent functions.
Macro Call
Format: macro directive name [real meta table]
Entity table: argument. Each note is separated by commas.
Note: You can call a macro directive only if it is defined first.
Example: MULTIPLY CX,VAR,XYZ[BX]
Macro calls are allowed in the macro definition, with the following restrictions: first defined and then called!
Macro definitions can be used not only for macro calls, but also for macro definitions.
List pseudo action
. LALL: Lists all statements (including comments) after the macro expansion in the LST manifest.
. SALL: No macro-Expanded statements are listed in the LST manifest.
. Xall: Omitted list mode, listing only the statements that produce the target code.
Purge Pseudo-operation
The difference between a macro call and a subroutine call:
Subroutine call: Called during program execution, only takes up a space of its own size.
Macro invocation: Expanded during assembly, the macro definition body is expanded once per call.
Assembly--Advanced assembly language Technology