Several special symbols in ARM instructions

Publisher:SereneWhisperLatest update time:2012-08-11 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Summarize the meaning of several special symbols in ARM instructions

Special symbols corresponding to the meaning of instructions

= DCB allocates a continuous byte storage unit and initializes it with the specified data

& DCD allocates a continuous word storage unit and initializes it with the specified data

% SPACE allocates a continuous storage unit

^ MAP defines the first address of a structured memory table

# FILED defines a data field of a structured memory table (often used together with MAP, one defines the starting address and the other defines the length)

* EQU defines an equivalent character name for a constant, label, etc. in a program, similar to #define in C language

! Address Update

[ Equivalent to IF

| Equivalent to ELSE

] Equivalent to ENDIF

Common data definition pseudo instructions are as follows:

— DCB is used to allocate a continuous byte storage unit and initialize it with specified data.

— DCW ( DCWU ) is used to allocate a contiguous half-word storage unit and initialize it with the specified data.

— DCD ( DCDU ) is used to allocate a continuous block of word memory locations and initialize them with specified data.

— DCFD ( DCFDU ) is used to allocate a continuous word storage unit for double-precision floating-point numbers and initialize it with the specified data.

— DCFS ( DCFSU ) is used to allocate a continuous word storage unit for single-precision floating-point numbers and initialize it with the specified data.

— DCQ ( DCQU ) is used to allocate a continuous storage unit of 8 bytes and initialize it with the specified data.

— SPACE is used to allocate a continuous storage unit

— MAP is used to define the first address of a structured memory table

— FIELD is used to define the data field of a structured memory table

1. DCB syntax format: label DCB expression The DCB directive is used to allocate a continuous byte storage unit and initialize it with the expression specified in the directive. The expression can be a number or a string of 0 to 255. DCB can also be replaced by "=".

Usage example: STr DCB “ This is a test !”; allocates a continuous byte storage unit and initializes it.

2. DCW (or DCWU) Syntax format: label DCW (or DCWU) expression The DCW (or DCWU) pseudo-instruction is used to allocate a continuous half-word storage unit and initialize it with the expression specified in the pseudo-instruction. The expression can be a program label or a numeric expression. The word storage unit allocated by DCW is half-word aligned, while the word storage unit allocated by DCWU is not strictly half-word aligned. [page]

Usage example: Datatest DCW 1, 2, 3; allocate a continuous half-word storage unit and initialize it.

3. Syntax format of DCD (or DCDU): label DCD (or DCDU) expression The DCD (or DCDU) directive is used to allocate a continuous word storage unit and initialize it with the expression specified in the directive. The expression can be a program label or a numeric expression. DCD can also be replaced by "&". The word storage unit allocated by DCD is word-aligned, while the word storage unit allocated by DCDU is not strictly word-aligned.

Usage example: DataTest DCD 4, 5, 6; allocate a continuous word storage unit and initialize it.

4. DCFD (or DCFDU) Syntax format: Label DCFD (or DCFDU) Expression The DCFD (or DCFDU) directive is used to allocate a continuous word storage unit for double-precision floating-point numbers and initialize it with the expression specified in the directive. Each double-precision floating-point number occupies two word units. The word storage units allocated by DCFD are word-aligned, while the word storage units allocated by DCFDU are not strictly word-aligned.

Example: FDataTest DCFD 2E115, -5E7; Allocate a continuous word storage unit and initialize it to the specified double precision number.

5. DCFS (or DCFSU) Syntax format: Label DCFS (or DCFSU) Expression The DCFS (or DCFSU) directive is used to allocate a continuous word storage unit for single-precision floating-point numbers and initialize it with the expression specified in the directive. Each single-precision floating-point number occupies one word unit. The word storage unit allocated by DCFS is word-aligned, while the word storage unit allocated by DCFSU is not strictly word-aligned.

Example: FDataTest DCFS 2E5, -5E - 7; allocates a continuous word storage unit and initializes it to the specified single-precision number.

6. DCQ (or DCQU) Syntax format: Label DCQ (or DCQU) Expression The DCQ (or DCQU) directive is used to allocate a continuous storage area of ​​8 bytes and initialize it with the expression specified in the directive. The storage unit allocated by DCQ is word-aligned, while the storage unit allocated by DCQU is not strictly word-aligned.

Example: DataTest DCQ 100; Allocate a continuous storage unit and initialize it to the specified value.

7. SPACE Syntax format: label SPACE expression The SPACE directive is used to allocate a continuous storage area and initialize it to 0. The expression is the number of bytes to be allocated. SPACE can also be replaced by "%".

Usage example: DataSpace SPACE 100; allocate 100 consecutive bytes of storage units and initialize them to 0.

8. MAP syntax format: MAP expression {, base register} The MAP directive is used to define the first address of a structured memory table. MAP can also be replaced by "^". The expression can be a label or a mathematical expression in the program. The base register is an optional option. When the base register option does not exist, the value of the expression is the first address of the memory table. When the option exists, the first address of the memory table is the sum of the value of the expression and the base register. The MAP directive is usually used in conjunction with the FIELD directive to define a structured memory table.

Usage example: MAP 0x100, R0; defines the value of the first address of the structured memory table to be 0x100 + R0.

9. FILED Syntax format: label FIELD expression The FIELD directive is used to define a data field in a structured memory table. FILED can also be replaced by "#". The value of the expression is the number of bytes occupied by the current data field in the memory table. The FIELD directive is often used in conjunction with the MAP directive to define a structured memory table. The MAP directive defines the first address of the memory table, and the FIELD directive defines each data field in the memory table, and can specify a label for each data field for reference by other instructions. Note that the MAP and FIELD directives are only used to define data structures and do not actually allocate storage units.

Usage example: MAP 0x100; define the value of the first address of the structured memory table to be 0x100. A FIELD 16; define the length of A to be 16 bytes and the position to be 0x100 B FIELD 32; define the length of B to be 32 bytes and the position to be 0x110 S FIELD 256; define the length of S to be 256 bytes and the position to be 0x13

Reference address:Several special symbols in ARM instructions

Previous article:System design of X86 to ARM binary translation and execution function based on SoC
Next article:Mainstream 32-bit MCU strategy series: Why learn STM32?

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号