Assembly--Advanced assembly language Technology

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.