6 equ – ARM VERSION 1.2 User Manual

Page 339

Advertising
background image

Directives Reference

ARM DUI 0068B

Copyright © 2000, 2001 ARM Limited. All rights reserved.

7-57

7.7.6

EQU

The

EQU

directive gives a symbolic name to a numeric constant, a register-relative value

or a program-relative value.

*

is a synonym for

EQU

.

Syntax

name EQU expr{, type}

where:

name

is the symbolic name to assign to the value.

expr

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

type

is optional.

type

can be any one of:

CODE16

CODE32

DATA

You can use

type

only if

expr

is an absolute address. If

name

is exported,

the

name

entry in the symbol table in the object file will be marked as

CODE16

,

CODE32

, or

DATA

, according to

type

. This can be used by the linker.

Usage

Use

EQU

to define constants. This is similar to the use of

#define

to define a constant in C.

See KEEP on page 7-64 and EXPORT or GLOBAL on page 7-58 for information on
exporting symbols.

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

Advertising