Arm base seven, arm pseudo operation and pseudo instruction __arm_arm Foundation

Source: Internet
Author: User
Tags define local

Pseudo-operation supported by ARM assembler

1. Definition

in Arm assembly language programs, there are special instruction mnemonics, which are different from the mnemonics of the instruction system, and do not have corresponding opcode, which is usually called pseudo operation identifier , which is called pseudo operation. /c4>.

2, symbol definition pseudo operation

Symbol definition pseudo operations are used to define variables in arm assembler, assign values to variables, and define aliases for registers. Common symbols define pseudo operations in the following ways:
(1) Gbla, GBLL, and gbls that define global variables.
(2) Lcla, LCLL, and lcls that define local variables.
(3) Seta, Setl, and sets that are used to assign values to variables.
(4) The rlist that defines the name for the generic register list.

3. Data definition pseudo Operation

data-definition pseudo operations are typically used to allocate storage units for specific data, and to complete initialization of allocated storage units. Common data-definition pseudo operations are as follows:
(1) DCB is used to allocate a contiguous byte storage unit and initialize the specified data.
(2) DCW (DCWU) is used to allocate a contiguous half word storage unit and initialize the specified data.
(3) DCD (DCDU) is used to allocate a contiguous word storage unit and initialize the specified data.
(4) DCFD (DCFDU) is used to assign a contiguous word storage unit to a double-precision floating-point number and to initialize the specified data.
(5) DCFS (DCFSU) is used to allocate a contiguous word storage unit for a single-precision floating-point number and to initialize the specified data.
(6) DCQ (DCQU) is used to allocate a contiguous storage unit in 8-byte units and initialize with the specified data.
(7) Space for allocating a contiguous storage unit
(8) Map is used to define a structured memory table first address
(9) field is used to define a data field for a structured memory table

4. Assembly Control pseudo Operation

The assembly control pseudo operation is used to control the execution flow of assembler, and the common assembly control pseudo operation includes the following several.
(1) IF, ELSE, ENDIF
(2) while, Wend
(3) MACRO, MEND
(4) Mexit

5. Miscellaneous pseudo-Operation

(1) area is used to define a code segment or data segment
(2) Align for the current position of the program to meet a certain alignment
(3) Entry for specifying program entry points
(4) End is used to indicate that the source program ends
(5) Equ for defining character names
(6) EXPORT (or global) used to declare symbols that can be referenced by other files
(7) Exportas is used to introduce symbols to the target file
(8) Import is used to inform the compiler that the current symbol is not in this file
(9) extern is used to inform the compiler that the label to use is defined in other source files, but to be referenced in the current source file
(a) Get (or include) is used to include a file in the current source file
(one) Incbin is used to include a file in the current source file






second, the arm assembler support pseudo instruction

the arm assembler supports arm pseudo directives, which are translated into arm or thumb (or Thumb-2) instructions (or instruction sequences) during the assembly phase.
1, ADR pseudo instruction (can only be replaced by a compilation instruction)
2, ADRL pseudo instruction (with two assembly instruction substitution: 1 useful +1 useless/2 useful)

the essence of ADR and ADRL pseudo directives : to store the relative offset value of a PC in a register
3, Ldr pseudo instructions (can completely replace ADR and ADRL)

the essence of the LDR pseudo Directive : LDR rd,=const (const If it is a valid number, will be translated into MOV, MVN; If the const is not a valid number, the immediate number to put into the register is stored in a memory address. The LDR pseudo instruction is then translated into a LDR instruction, and then the immediate number is read from the address.

4, NOP pseudo instructions: In the Assembly will be replaced by the arm in the empty operation



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.