You copied the Doc URL to your clipboard.

21.26 EQU

The EQU directive gives a symbolic name to a numeric constant, a register-relative value or a PC-relative value.

Syntax

name EQU expr{, type}

where:

name

is the symbolic name to assign to the value.

expr

is a register-relative address, a PC-relative address,an absolute address, or a 32-bit integer constant.

type

is optional. type canbe any one of:

  • ARM.

  • THUMB.

  • CODE32.

  • CODE16.

  • DATA.

You can use type onlyif expr is an absolute address.If name is exported, the name entryin the symbol table in the object file is marked as ARM, THUMB, CODE32, CODE16, or DATA,according to type. This canbe used by the linker.

Usage

Use EQU to define constants. This issimilar to the use of #define to define a constantin C.

* is a synonym for EQU.

Examples

abc EQU 2               ; Assigns the value 2 to the symbol abc.xyz EQU label+8         ; Assigns the address (label+8) to the                        ; symbol xyz.fiq EQU 0x1C, CODE32    ; Assigns the absolute address 0x1C to                        ; the symbol fiq, and marks it as code.

Related reference

Was this page helpful? Yes No