GNU-style Arm Assembly syntax Guide (very detailed) 4

Source: Internet
Author: User

Conversion from: GNU-style Arm Assembly syntax Guide (very detailed) 4

4. GNU assembly language definition entry point

The default entry for assembler is_ StartLabel,You can also use the entry mark in the connection script file to specify other entry points..

Example: Define the entry point

. Section. Data

<Initialized data here>

. Section. BSS

<Uninitialized data here>

. Section. Text

. Globl _ start

_ Start:

<Instruction code goes here>

 

5. macro definition in GNU Assembler

The format is as follows:

. Macro macro name parameter name list @ pseudodirective. Macro defines a macro

Macro

. Endm @. endm indicates that the macro ends.

If a macro uses a parameter, the prefix is added when the macro uses this parameter."\". Default values can also be used for macro-defined parameters. You can use the. exitm pseudo command to exit the macro.

For example, macro definition

. Macro shiftleft a, B

. If \ B <0

Mov \ A, \ A, ASR #-\ B

. Exitm

. Endif

Mov \ A, \ A, LSL # \ B

. Endm

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.