Skip to main content

IAR Embedded Workbench for Arm 9.70.x

Summary of assembler directives

In this section:

The assembler directives are classified into these groups according to their function:

This table gives a summary of all the assembler directives:

Directive

Description

Section

_args

Is set to number of arguments passed to macro.

Macro processing

$

Includes a file.

Assembler control

#define

Assigns a value to a label.

C-style preprocessor

#elif

Introduces a new condition in an #if#endif block.

C-style preprocessor

#else

Assembles instructions if a condition is false.

C-style preprocessor

#endif

Ends an #if, #ifdef, or #ifndef block.

C-style preprocessor

#error

Generates an error.

C-style preprocessor

#if

Assembles instructions if a condition is true.

C-style preprocessor

#ifdef

Assembles instructions if a symbol is defined.

C-style preprocessor

#ifndef

Assembles instructions if a symbol is undefined.

C-style preprocessor

#include

Includes a file.

C-style preprocessor

#message

Generates a message on standard output.

C-style preprocessor

#pragma

Recognized but ignored.

C-style preprocessor

#undef

Undefines a label.

C-style preprocessor

/*comment*/

C-style comment delimiter.

Assembler control

//

C++ style comment delimiter.

Assembler control

=

Assigns a permanent value local to a module.

Value assignment

AAPCS

Sets module attributes.

Module control

ALIAS

Assigns a permanent value local to a module.

Value assignment

ALIGN

Aligns the program location counter by inserting zero-filled bytes.

Section control

ALIGNRAM

Aligns the program location counter.

Section control

ALIGNROM

Aligns the program location counter by inserting zero-filled bytes.

Section control

ARM

Interprets subsequent instructions as 32-bit (Arm) instructions.

Mode control

ASEGN

Begins a named absolute segment.

Segment control

ASSIGN

Assigns a temporary value.

Value assignment

CALL_GRAPH_ROOT

Specifies that a function is a call graph root.

Function

CASEOFF

Disables case sensitivity.

Assembler control

CASEON

Enables case sensitivity.

Assembler control

CFI

Specifies call frame information.

Call frame information

CODE

Interprets subsequent instructions as Arm, Thumb, or A64 instructions, depending on the setting of related assembler options.

Mode control

CODE16

Interprets subsequent instructions as 16-bit (Thumb) instructions. Replaced by THUMB.

Mode control

CODE32

Interprets subsequent instructions as 32-bit (Arm) instructions. Replaced by ARM.

Mode control

COL

Sets the number of columns per page. Retained for backward compatibility reasons—recognized but ignored.

Listing control

DATA

Defines an area of data within a code section.

Mode control

DATA64

Defines an area of data within a code section, marked as 64-bit data as a hint for disassemblers.

Mode control

DC8

Generates 8-bit constants, including strings.

Data definition or allocation

DC16

Generates 16-bit constants.

Data definition or allocation

DC24

Generates 24-bit constants.

Data definition or allocation

DC32

Generates 32-bit constants.

Data definition or allocation

DC64

Generates 64-bit constants.

Data definition or allocation

DCB

Generates 8-bit byte constants, including strings.

Data definition or allocation

DCD

Generates 32-bit long word constants. Alias for DC32.

Data definition or allocation

DCQ

Generates 64-bit long constants. Alias for DC64.

Data definition or allocation

DCW

Generates 16-bit word constants, including strings. Alias for DC16.

Data definition or allocation

DEFINE

Defines a file-wide value.

Value assignment

DF16

Generates 16-bit half precision floating point constants.

Data definition or allocation

DF32

Generates 32-bit floating-point constants.

Data definition or allocation

DF64

Generates 64-bit floating-point constants.

Data definition or allocation

DS8

Allocates space for 8-bit integers.

Data definition or allocation

DS16

Allocates space for 16-bit integers.

Data definition or allocation

DS24

Allocates space for 24-bit integers.

Data definition or allocation

DS32

Allocates space for 32-bit integers.

Data definition or allocation

DS64

Allocates space for 64-bit integers.

Data definition or allocation

ELSE

Assembles instructions if a condition is false.

Conditional assembly

ELSEIF

Specifies a new condition in an IFENDIF block.

Conditional assembly

END

Ends the assembly of the last module in a file.

Module control

ENDIF

Ends an IF block.

Conditional assembly

ENDM

Ends a macro definition.

Macro processing

ENDR

Ends a repeat structure.

Macro processing

EQU

Assigns a permanent value local to a module.

Value assignment

EVEN

Aligns the program counter to an even address.

Section control

EXITM

Exits prematurely from a macro.

Macro processing

EXTERN

Imports an external symbol.

Symbol control

EXTWEAK

Imports an external symbol (which can be undefined.

Symbol control

IF

Assembles instructions if a condition is true.

Conditional assembly

IMPORT

Imports an external symbol.

Symbol control

INCLUDE

Includes a file.

Assembler control

LOCAL

Creates symbols local to a macro.

Macro processing

LSTCND

Controls conditional assembler listing.

Listing control

LSTCOD

Controls multi-line code listing.

Listing control

LSTEXP

Controls the listing of macro generated lines.

Listing control

LSTMAC

Controls the listing of macro definitions.

Listing control

LSTOUT

Controls assembler-listing output.

Listing control

LSTPAG

Retained for backward compatibility reasons. Recognized but ignored.

Listing control

LSTREP

Controls the listing of lines generated by repeat directives.

Listing control

LSTXRF

Generates a cross-reference table.

Listing control

LTORG

Directs the current literal pool to be assembled immediately following the directive.

Assembler control

MACRO

Defines a macro.

Macro processing

ODD

Aligns the program location counter to an odd address.

Section control

OVERLAY

Recognized but ignored.

Symbol control

PAGE

Retained for backward compatibility reasons.

Listing control

PAGSIZ

Retained for backward compatibility reasons.

Listing control

PRESERVE8

Sets a module attribute.

Module control

PUBLIC

Exports symbols to other modules.

Symbol control

PUBWEAK

Exports symbols to other modules, multiple definitions allowed.

Symbol control

RADIX

Sets the default base.

Assembler control

REPT

Assembles instructions a specified number of times.

Macro processing

REPTC

Repeats and substitutes characters.

Macro processing

REPTI

Repeats and substitutes strings.

Macro processing

REQUIRE

Forces a symbol to be referenced.

Symbol control

REQUIRE8

Sets a module attribute.

Module control

RSEG

Begins a section.

Section control

RTMODEL

Declares runtime model attributes.

Module control

SECTION

Begins a section.

Section control

SECTION_TYPE

Sets ELF type and flags for a section.

Section control

SETA

Assigns a temporary value.

Value assignment

THUMB

Interprets subsequent instructions as Thumb execution-mode instructions.

Mode control

Table 145. Assembler directives summary