EWCF AssemblerReference
EWCF AssemblerReference
Reference Guide
for Freescale’s
ColdFire Microcontroller Family
ACF-1:Final
COPYRIGHT NOTICE
© Copyright 2007 IAR Systems. All rights reserved.
No part of this document may be reproduced without the prior written consent of IAR
Systems. The software described in this document is furnished under a license and may
only be used or copied in accordance with the terms of such a license.
DISCLAIMER
The information in this document is subject to change without notice and does not
represent a commitment on any part of IAR Systems. While the information contained
herein is assumed to be accurate, IAR Systems assumes no responsibility for any errors
or omissions.
In no event shall IAR Systems, its employees, its contractors, or the authors of this
document be liable for special, direct, indirect, or consequential damage, losses, costs,
charges, claims, demands, claim for lost profits, fees, or expenses of any nature or kind.
TRADEMARKS
IAR, IAR Systems, IAR Embedded Workbench, IAR MakeApp, C-SPY, visualSTATE,
From Idea To Target, IAR KickStart Kit and IAR PowerPac are trademarks or registered
trademarks owned by IAR Systems AB.
FreescaleTM and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
Microsoft and Windows are registered trademarks of Microsoft Corporation.
All other product names are trademarks or registered trademarks of their respective
owners.
EDITION NOTICE
First edition: September 2007
Part number: ACF-1
This guide applies to version 1.x of the ColdFire® IAR Embedded Workbench® IDE.
Internal reference: ISUD.
ACF-1:Final
Contents
Tables ...................................................................................................................... vii
Preface ..................................................................................................................... ix
iii
ACF-1:Final
List file format .......................................................................................... 13
Header ................................................................................................ 13
Body ................................................................................................... 13
Summary ............................................................................................ 13
Symbol and cross-reference table ...................................................... 13
Programming hints ................................................................................ 14
Accessing special function registers .................................................. 14
Using C-style preprocessor directives ................................................ 14
ACF-1:Final
Contents
Descriptions ....................................................................................... 54
Symbol control directives ................................................................... 56
Syntax ................................................................................................. 57
Parameters .......................................................................................... 57
Descriptions ....................................................................................... 57
Examples ............................................................................................ 58
Segment control directives ................................................................ 59
Syntax ................................................................................................. 59
Parameters .......................................................................................... 60
Descriptions ....................................................................................... 60
Examples ............................................................................................ 62
Value assignment directives .............................................................. 64
Syntax ................................................................................................. 64
Parameters .......................................................................................... 64
Descriptions ....................................................................................... 64
Examples ............................................................................................ 65
Conditional assembly directives ....................................................... 68
Syntax ................................................................................................. 68
Parameters ......................................................................................... 68
Descriptions ....................................................................................... 69
Examples ............................................................................................ 69
Macro processing directives ............................................................... 70
Syntax ................................................................................................. 70
Parameters .......................................................................................... 70
Descriptions ....................................................................................... 71
Examples ............................................................................................ 74
Listing control directives ..................................................................... 77
Syntax ................................................................................................. 78
Descriptions ....................................................................................... 78
Examples ............................................................................................ 79
C-style preprocessor directives ........................................................ 81
Syntax ................................................................................................. 81
Parameters .......................................................................................... 82
Descriptions ....................................................................................... 82
ACF-1:Final
Examples ............................................................................................ 84
Data definition or allocation directives ......................................... 85
Syntax ................................................................................................. 86
Parameters .......................................................................................... 87
Descriptions ....................................................................................... 87
Examples ............................................................................................ 87
Assembler control directives ............................................................ 88
Syntax ................................................................................................. 89
Parameters .......................................................................................... 89
Descriptions ....................................................................................... 89
Examples ............................................................................................ 89
Function directives ................................................................................. 90
Syntax ................................................................................................. 91
Parameters .......................................................................................... 91
Descriptions ....................................................................................... 91
Call frame information directives ................................................... 92
Syntax ................................................................................................. 93
Parameters .......................................................................................... 94
Descriptions ....................................................................................... 95
Simple rules ........................................................................................ 99
CFI expressions ................................................................................ 101
Example ........................................................................................... 103
ACF-1:Final
Tables
1: Typographic conventions used in this guide .......................................................... xi
2: Assembler environment variables ........................................................................... 4
3: Assembler error return codes .................................................................................. 4
4: Integer constant formats .......................................................................................... 6
5: ASCII character constant formats ........................................................................... 7
6: Floating-point constants .......................................................................................... 7
7: Predefined register symbols .................................................................................... 9
8: Predefined symbols ................................................................................................. 9
9: Symbol and cross-reference table ......................................................................... 14
10: Assembler options summary ............................................................................... 17
11: Generating a list of dependencies (--dependencies) ............................................ 20
12: Conditional list options (-l) ................................................................................. 25
13: Directing preprocessor output to file (--preprocess) ........................................... 29
14: Assembler directives summary ........................................................................... 49
15: Module control directives ................................................................................... 53
16: Symbol control directives ................................................................................... 56
17: Segment control directives .................................................................................. 59
18: Value assignment directives ................................................................................ 64
19: Conditional assembly directives ......................................................................... 68
20: Macro processing directives ................................................................................ 70
21: Listing control directives ..................................................................................... 77
22: C-style preprocessor directives ........................................................................... 81
23: Data definition or allocation directives ............................................................... 85
24: Assembler control directives ............................................................................... 88
25: Call frame information directives ....................................................................... 92
26: Unary operators in CFI expressions .................................................................. 101
27: Binary operators in CFI expressions ................................................................. 101
28: Ternary operators in CFI expressions ............................................................... 102
29: Code sample with backtrace rows and columns ............................................... 103
30: Pragma directives summary .............................................................................. 107
vii
ACF-1:Final
ColdFire® IAR Assembler
viii Reference Guide
ACF-1:Final
Preface
Welcome to the ColdFire® IAR Assembler Reference Guide. The purpose of
this guide is to provide you with detailed reference information that can help
you to use the ColdFire IAR Assembler to develop your application according
to your requirements.
ix
ACF-1:Final
What this guide contains
Other documentation
The complete set of IAR Systems development tools for the ColdFire microcontroller is
described in a series of guides and online help files. For information about:
● Using the IAR Embedded Workbench® IDE with the IAR C-SPY® Debugger, refer
to the IAR Embedded Workbench® IDE User Guide
● Programming for the ColdFire IAR C/C++ Compiler, refer to the ColdFire® IAR
C/C++ Compiler Reference Guide
● Using the IAR XLINK Linker, the IAR XAR Library Builder, and the IAR XLIB
Librarian, refer to the IAR Linker and Library Tools Reference Guide
● Using the IAR DLIB Library, refer to the online help system.
All of these guides are delivered in hypertext PDF or HTML format on the installation
media. Some of them are also delivered as printed books.
ACF-1:Final
Preface
Document conventions
This guide uses the following typographic conventions:
Style Used for
computer Text that you enter or that appears on the screen.
parameter A label representing the actual value you should enter as part of a
command.
[option] An optional part of a command.
{option} An mandatory part of a command.
a | b | c Alternatives in a command.
bold Names of menus, menu commands, buttons, and dialog boxes that
appear on the screen.
reference A cross-reference within this guide or to another guide.
… An ellipsis indicates that the previous item can be repeated an arbitrary
number of times.
Identifies instructions specific to the IAR Embedded Workbench
interface.
Identifies instructions specific to the command line interface.
xi
ACF-1:Final
Document conventions
ACF-1:Final
Introduction to the
ColdFire IAR Assembler
This chapter contains the following sections:
● Modular programming
● Source format
● Assembler instructions
● Programming hints.
GETTING STARTED
To ease the start of the development of your assembler application, you can:
● Work through the tutorials—especially the one about mixing C and assembler
modules—that you find in the IAR Embedded Workbench® IDE User Guide
● Read about the assembler language interface—also useful when mixing C and
assembler modules—in the ColdFire® IAR C/C++ Compiler Reference Guide
ACF-1:Final
Modular programming
● In the IAR Embedded Workbench IDE, you can base a new project on a template
for an assembler project.
Modular programming
It is widely accepted that modular programming is a prominent feature of good software
design. By structuring your code in small modules—in contrast to one single
monolith—you can organize your application code in a logical structure, which makes
the code easier to understand, and which aids:
● efficient program development
● reuse of modules
● maintenance.
The IAR development tools provide different facilities for achieving a modular structure
in your software.
Typically, you write your assembler code in assembler source files. In each source file,
you define one or several assembler modules by using the module control directives.
Each module has a name and a type, where the type can be either PROGRAM or LIBRARY.
The linker will always include a PROGRAM module, whereas a LIBRARY module is only
included in the linked code if other modules refer to a public symbol in the module. Each
module can be further divided into subroutines.
A segment is a logical entity containing a piece of data or code that should be mapped
to a physical location in memory. You place your code and data in segments by using the
segment control directives. A segment can be either absolute or relocatable. An absolute
segment always has a fixed address in memory, whereas the address for a relocatable
segment is resolved at link time. By using segments, you can control how your code and
data will be placed in memory. Each segment consists of many segment parts. A
segment part is the smallest linkable unit, which allows the linker to include only those
units that are referred to.
If you are working on a large project you will soon accumulate a collection of useful
routines that are used by several of your applications. To avoid ending up with a huge
amount of small object files, you can collect modules that contain such routines in a
library object file. In the IAR Embedded Workbench IDE, it is possible to set up a
library project, to collect many object files in one library. For an example, see the
tutorials in the IAR Embedded Workbench® IDE User Guide.
To summarize, your software design benefits from modular programming, and to
achieve a modular structure you can:
● Create many small modules, either one per source file, or many modules per file by
using the module directives
ACF-1:Final
Introduction to the ColdFire IAR Assembler
● In each module, divide your assembler source code into small subroutines
(corresponding to functions on the C level)
● Divide your assembler source code into segments, to gain more precise control of
how your code and data finally will be placed in memory
● Collect your routines in libraries, which means that you can reduce the number of
object files and make the modules conditionally linked.
For example, when assembling the source file prog.s68, use the following command
to generate an object file with debug information:
acf prog --debug
By default, the ColdFire IAR Assembler recognizes the filename extensions s68, asm,
and msa for source files. The default filename extension for assembler output is r68.
Generally, the order of options on the command line, both relative to each other and to
the source filename, is not significant. There is, however, one exception: when you use
the -I option, the directories are searched in the same order that they are specified on the
command line.
If you run the assembler from the command line without any arguments, the assembler
version number and all available options including brief descriptions are directed to
stdout and displayed on the screen.
PASSING OPTIONS
There are three different ways of passing options to the assembler:
● Directly from the command line
Specify the options on the command line after the acf command; see Assembler
invocation syntax, page 3.
ACF-1:Final
External interface details
ENVIRONMENT VARIABLES
Assembler options can also be specified in the ASMCF environment variable. The
assembler automatically appends the value of this variable to every command line, so it
provides a convenient method of specifying options that are required for every assembly.
The following environment variables can be used with the ColdFire IAR Assembler:
Environment variable Description
ASMCF Specifies command line options; for example:
set ASMCF=-L -ws
ASMCF_INC Specifies directories to search for include files; for example:
set ASMCF_INC=c:\myinc\
Table 2: Assembler environment variables
For example, setting the following environment variable will always generate a list file
with the name temp.lst:
set ASMCF=-l temp.lst
For information about the environment variables used by the IAR XLINK Linker and
the IAR XLIB Librarian, see the IAR Linker and Library Tools Reference Guide.
ACF-1:Final
Introduction to the ColdFire IAR Assembler
Source format
The format of an assembler source line is as follows:
[label [:]] [operation] [operands] [; comment]
Assembler instructions
The ColdFire IAR Assembler supports the syntax for assembler instructions as
described in Freescale’s documentation ColdFire® Family Programmer’s Reference
Manual (document number CFPRM, Rev3, 03/2005).
ACF-1:Final
Expressions, operands, and operators
INTEGER CONSTANTS
Because all IAR Systems assemblers use 32-bit two’s complement internal arithmetic,
integers have a (signed) range from -2147483648 to 2147483647.
Constants are written as a sequence of digits with an optional - (minus) sign in front to
indicate a negative number.
Commas and decimal points are not permitted.
The following types of number representation are supported:
Integer type Example
Binary 1010b
Octal 1234q, 0123
Decimal 1234, -1, 1234d
Hexadecimal 0FFFFh, 0xFFFF
Table 4: Integer constant formats
Note: Both the prefix and the suffix can be written with either uppercase or lowercase
letters.
ACF-1:Final
Introduction to the ColdFire IAR Assembler
FLOATING-POINT CONSTANTS
The ColdFire IAR Assembler will accept floating-point values as constants and convert
them into IEEE single-precision (signed 32-bit) floating-point format and
double-precision (signed 64-bit), or fractional format.
Floating-point numbers can be written in the format:
[+|-][digits].[digits][{E|e}[+|-]digits]
The following table shows some valid examples:
Format Value
10.23 1.023 x 101
1.23456E-24 1.23456 x 10-24
1.0E3 1.0 x 103
Table 6: Floating-point constants
ACF-1:Final
Expressions, operands, and operators
SYMBOLS
User-defined symbols can be up to 255 characters long, and all characters are
significant. Depending on what kind of operation a symbol is followed by, the symbol
is either a data symbol or an address symbol where the latter is referred to as a label. A
symbol before an instruction is a label and a symbol before, for example the EQU
directive, is a data symbol. A symbol can be:
● absolute—its value is known by the assembler
● relocatable—its value is resolved at link time.
Symbols must begin with a letter, a–z or A–Z, ? (question mark), or _ (underscore).
Symbols can include the digits 0–9 and $ (dollar).
Case is insignificant for built-in symbols like instructions, registers, operators, and
directives. For user-defined symbols case is by default significant but can be turned on
and off using the Case sensitive user symbols (--case_insensitive) assembler
option. See --case_insensitive, page 18 for additional information.
Use the symbol control directives to control how symbols are shared between modules.
For example, use the PUBLIC directive to make one or more symbols available to other
modules. The EXTERN directive is used for importing an untyped external symbol.
Note that symbols and labels are long addresses. For additional information, see
Generating a lookup table, page 87.
LABELS
Symbols used for memory locations are referred to as labels.
ACF-1:Final
Introduction to the ColdFire IAR Assembler
If you need to refer to the program location counter in your assembler source code you
can use the $ (dollar) sign. For example:
BRA $ ; Loop forever
REGISTER SYMBOLS
The following table shows the existing predefined register symbols:
Name Size Description
A0–A6 32 bits Address registers
A7/SP 32 bits Supervisor stack pointer
OTHER_A7 32 bits User stack pointer
D0–D7 32 bits Data registers
PC 32 bits Program counter
SR/CCR 16 bits/8 bits Status register / Conditional code register
VBR 32 bits Vector base register
Table 7: Predefined register symbols
PREDEFINED SYMBOLS
The ColdFire IAR Assembler defines a set of symbols for use in assembler source files.
The symbols provide information about the current assembly, allowing you to test them
in preprocessor directives or include them in the assembled code. The strings returned
by the assembler are enclosed in double quotes.
The following predefined symbols are available:
Symbol Value
__ACF__ An integer that is set to 1 when the code is assembled with
the ColdFire IAR Assembler.
__BUILD_NUMBER__ A unique integer that identifies the build number of the
assembler currently in use. The build number does not
necessarily increase with an assembler that is released later.
__DATE__ The current date in dd/Mmm/yyyy format (string).
__DIV__ An integer that identifies whether support for the
DIV/MOD instructions is enabled. The symbol reflects the
--no_div option and is defined to __NO_DIV__ or
__DIV_INSTR__. These symbolic names can be used
when testing the __DIV__ symbol.
__FILE__ The name of the current source file (string).
Table 8: Predefined symbols
ACF-1:Final
Expressions, operands, and operators
Symbol Value
__FPU__ An integer that identifies whether support for the
floating-point unit is enabled. The symbol reflects the
--fpu option and is defined to __NO_FPU__ or
__FP_UNIT__. These symbolic names can be used when
testing the __FPU__ symbol.
__IAR_SYSTEMS_ASM__ IAR assembler identifier (number).
__ISA__ An integer that identifies the code model in use. The
symbol reflects the --isa option and is defined to
__ISA_A__, __ISA_A_PLUS__, __ISA_B__, or
__ISA_C__. These symbolic names can be used when
testing the __ISA__ symbol.
__LINE__ The current source line number (number).
__MAC__ An integer that identifies whether support for MAC
instructions is enabled. The symbol reflects the --mac
option and is defined to __NO_MAC__, __EMAC__,
__EMAC_B__, or __MAC_UNIT__. These symbolic
names can be used when testing the __MAC__ symbol.
__SUPERVISOR__ An integer that identifies whether support for the
supervisor instructions is enabled. The symbol reflects the
--supervisor option and is defined to
__NO_SUPERVISOR__ or
__SUPERVISOR_INSTR__. These symbolic names can
be used when testing the __SUPERVISOR__ symbol.
__TID__ Target identity, consisting of two bytes (number). The high
byte is the target identity, which is 68 for ACF. The low
byte is the processor option *16. The value of the symbol is
0x4400.
__SUBVERSION__ An integer that identifies the version letter of the version
number, for example the C in 4.21C, as an ASCII character.
__TIME__ The current time in hh:mm:ss format (string).
__VER__ The version number in integer format; for example, version
4.17 is returned as 417 (number).
Table 8: Predefined symbols (Continued)
Note: The symbol __TID__ is related to the predefined symbol __TID__ in the
ColdFire IAR C/C++ Compiler. It is described in the ColdFire® IAR C/C++ Compiler
Reference Guide.
ACF-1:Final
Introduction to the ColdFire IAR Assembler
EXTERN printstr
RSEG CODE
11
ACF-1:Final
Expressions, operands, and operators
Such expressions are evaluated and resolved at link time, by the IAR XLINK Linker.
There are no restrictions on the expression; any operator can be used on symbols from
any segment, or any combination of segments.
For example, a program could define the segments DATA and CODE as follows:
NAME prog1
EXTERN third
RSEG DATA
first: DC8 5
second: DC8 3
RSEG CODE
start …
Then in the segment CODE, the following relocatable expressions are legal:
DC8 first
DC8 first+1
DC8 1+first
DC8 (first/second)*third
Note: At assembly time, there will be no range check. The range check will occur at link
time and, if the values are too large, there will be a linker error.
EXPRESSION RESTRICTIONS
Expressions can be categorized according to restrictions that apply to some of the
assembler directives. One such example is the expression used in conditional statements
like IF, where the expression must be evaluated at assembly time and therefore cannot
contain any external symbols.
The following expression restrictions are referred to in the description of each directive
they apply to.
No forward
All symbols referred to in the expression must be known, no forward references are
allowed.
No external
No external references in the expression are allowed.
ACF-1:Final
Introduction to the ColdFire IAR Assembler
Absolute
The expression must evaluate to an absolute value; a relocatable value (segment offset)
is not allowed.
Fixed
The expression must be fixed, which means that it must not depend on variable-sized
instructions. A variable-sized instruction is an instruction that may vary in size
depending on the numeric value of its operand.
HEADER
The header section contains product version information, the date and time when the file
was created, and which options were used.
BODY
The body of the listing contains the following fields of information:
● The line number in the source file. Lines generated by macros will, if listed, have a
. (period) in the source line number field.
● The address field shows the location in memory, which can be absolute or relative
depending on the type of segment. The notation is hexadecimal.
● The data field shows the data generated by the source line. The notation is
hexadecimal. Unresolved values are represented by ..... (periods), where two periods
signify one byte. These unresolved values will be resolved during the linking
process.
● The assembler source line.
SUMMARY
The end of the file contains a summary of errors and warnings that were generated.
13
ACF-1:Final
Programming hints
Programming hints
This section gives hints on how to write efficient code for the ColdFire IAR Assembler.
For information about projects including both assembler and C or C++ source files, see
the ColdFire® IAR C/C++ Compiler Reference Guide.
ACF-1:Final
Assembler options
This chapter first explains how to set the options from the command line, and
gives an alphabetical summary of the assembler options. It then provides
detailed reference information for each assembler option.
The IAR Embedded Workbench® IDE User Guide describes how to set assembler
options in the IAR Embedded Workbench® IDE, and gives reference
information about the available options.
Some options accept a filename, included after the option letter with a separating space.
For example, to generate a listing to the file prog.lst:
acf prog -l prog.lst
Some other options accept a string that is not a filename. The string is included after the
option letter, but without a space. For example, to define a symbol:
acf prog -DDEBUG=1
Generally, the order of options on the command line, both relative to each other and to
the source filename, is not significant. There is, however, one exception: when you use
the -I option, the directories are searched in the same order as they are specified on the
command line.
Notice that a command line option has a short name and/or a long name:
● A short option name consists of one character, with or without parameters. You
specify it with a single dash, for example -r.
● A long name consists of one or several words joined by underscores, and it may
have parameters. You specify it with double dashes, for example --debug.
15
ACF-1:Final
Setting assembler options
SPECIFYING PARAMETERS
When a parameter is needed for an option with a short name, it can be specified either
immediately following the option or as the next command line argument.
For instance, an include file path of \usr\include can be specified either as:
-I\usr\include
or as
-I \usr\include
or
--diag_suppress Pe0001
Options that accept multiple values may be repeated, and may also have
comma-separated values (without space), for example:
--diag_warning=Be0001,Be0002
ACF-1:Final
Assembler options
17
ACF-1:Final
Description of assembler options
--case_insensitive --case_insensitive
ACF-1:Final
Assembler options
-D -Dsymbol[=value]
Defines a symbol to be used by the preprocessor with the name symbol and the value
value. If no value is specified, 1 is used.
The -D option allows you to specify a value or choice on the command line instead of
in the source file.
Example
You may want to arrange your source to produce either the test or production version of
your program dependent on whether the symbol TESTVER was defined. To do this use
include sections such as:
#ifdef TESTVER
... ; additional code lines for test version only
#endif
Alternatively, your source might use a variable that you need to change often. You can
then leave the variable undefined in the source, and use -D to specify the value on the
command line; for example:
acf prog -DFRAMERATE=3
Project>Options>Assembler>Preprocessor>Defined symbols
--debug, -r --debug
-r
The --debug option makes the assembler generate debug information that allows a
symbolic debugger such as the IAR C-SPY® Debugger to be used on the program.
In order to reduce the size and link time of the object file, the assembler does not
generate debug information by default.
Project>Options>Assembler >Output>Generate debug information
19
ACF-1:Final
Description of assembler options
When you use this option, each source file opened by the assembler is listed in a file.
The following modifiers are available:
Option modifier Description
i Include only the names of files (default)
m Makefile style
Table 11: Generating a list of dependencies (--dependencies)
If --dependencies=m is used, the output uses makefile style. For each source file, one
line containing a makefile dependency rule is output. Each line consists of the name of
the object file, a colon, a space, and the name of a source file. For example:
foo.r68: c:\iar\product\include\stdio.h
foo.r68: d:\myproject\include\foo.h
Example 1
To generate a listing of file dependencies to the file listing.i, use:
acf prog --dependencies=i listing
Example 2
To generate a listing of file dependencies to a file called listing.i in the mypath
directory, you would use:
acf prog --dependencies \mypath\listing
ACF-1:Final
Assembler options
Example 3
An example of using --dependencies with gmake:
1 Set up the rule for assembling files to be something like:
%.r68 : %.c
$(ASM) $(ASMFLAGS) $< --dependencies=m $*.d
That is, besides producing an object file, the command also produces a dependent file
in makefile style (in this example using the extension .d).
2 Include all the dependent files in the makefile using for example:
-include $(sources:.c=.d)
Because of the -, it works the first time, when the .d files do not yet exist.
This option is not available in the IAR Embedded Workbench IDE.
--diag_error --diag_error=tag,tag,...
--diag_remark --diag_remark=tag,tag,...
21
ACF-1:Final
Description of assembler options
--diag_suppress --diag_suppress=tag,tag,...
Use this option to suppress diagnostic messages. The following example suppresses the
warnings As001 and As002:
--diag_suppress=As001,As002
--diag_warning --diag_warning=tag,tag,...
Use this option to list all possible diagnostic messages in a named file. This can be very
convenient, for example, if you have used a #pragma directive to suppress or change the
severity level of any diagnostic messages, but forgot to document why.
This option cannot be given together with other options.
If a filename is specified, the assembler stores the output in that file.
If a directory is specified, the assembler stores the output in that directory, in a file
with the name diagnostics_tables.txt. To specify the working directory, replace
directory with a period (.).
Example 1
To output a list of all possible diagnostic messages to the file diag.txt, use:
--diagnostics_tables diag
Example 2
If you want to generate a table to a file diagnostics_tables.txt in the working
directory, you could use:
--diagnostics_tables .
ACF-1:Final
Assembler options
--dir_first --dir_first
The default behavior of the assembler is to treat all identifiers starting in the first column
as labels.
Use this option to make directive names (without a trailing colon) that start in the first
column to be recognized as directives.
Project>Options>Assembler >Language>Allow directives in first column
--enable_multibytes --enable_multibytes
By default, multibyte characters cannot be used in assembler source code. If you use this
option, multibyte characters in the source code are interpreted according to the host
computer’s default setting for multibyte support.
Multibyte characters are allowed in comments, in string literals, and in character
constants. They are transferred untouched to the generated code.
Project>Options>Assembler>Language>Enable multibyte support
--error_limit --error_limit=n
Use the --error_limit option to specify the number of errors allowed before the
assembler stops. By default, 100 errors are allowed. n must be a positive number; 0
indicates no limit.
This option is not available in the IAR Embedded Workbench IDE.
-f -f filename
Extends the command line with text read from the specified file. Notice that there must
be a space between the option itself and the filename.
The -f option is particularly useful where there is a large number of options which are
more conveniently placed in a file than on the command line itself. For example, to run
the assembler with further options taken from the file extend.xcl, use:
acf prog -f extend.xcl
23
ACF-1:Final
Description of assembler options
--fpu --fpu
--header_context --header_context
Occasionally, it is necessary to know which header file that was included from what
source line, to find the cause of a problem. Use this option to list, for each diagnostic
message, not only the source position of the problem, but also the entire include stack at
that point.
This option is not available in the IAR Embedded Workbench IDE.
-I -Iprefix
Example
For example, using the options:
-Ic:\global\ -Ic:\thisproj\headers\
in the source, will make the assembler search first in the current directory, then in the
directory c:\global\, and then in the directory C:\thisproj\headers\. Finally,
the assembler searches the directories specified in the ACF_INC environment variable,
provided that this variable is set.
Project>Options>Assembler >Preprocessor>Additional include directories
ACF-1:Final
Assembler options
--isa --isa={isa_a|isa_a+|isa_b|isa_c}
Use this option to select the version of the instruction set architecture to be used. If you
do not use the option to specify what instruction set to use, the compiler uses the isa_a
instruction set as default.
See also the device documentation delivered from the chip manufacturer.
Project>Options>General Options>Target>ISA variant
-l -l[a][d][e][m][o][x][N] {filename|directory}
By default, the assembler does not generate a listing. Use this option to generate a listing
to a file.
You can choose to include one or more of the following types of information:
Command line option Description
-la Assembled lines only
-ld The LSTOUT directive controls if lines are
written to the list file or not. Using -ld turns
the start value for this to off.
-le No macro expansions
-lm Macro definitions
-lo Multiline code
-lx Includes cross-references
-lN Do not include diagnostics
Table 12: Conditional list options (-l)
Example 1
To generate a listing to the file list.lst, use:
acf sourcefile -l list
25
ACF-1:Final
Description of assembler options
Example 2
If you assemble the file mysource.s68 and want to generate a listing to a file
mysource.lst in the working directory, you could use:
acf mysource -l .
-M -Mab
Specifies quote characters for macro arguments by setting the characters used for the left
and right quotes of each macro argument to a and b respectively.
By default, the characters are < and >. The -M option allows you to change the quote
characters to suit an alternative convention or simply to allow a macro argument to
contain < or > themselves.
Note: Depending on your host environment, it may be necessary to use quote marks
with the macro quote characters, for example:
acf filename -M’<>’
Example
For example, using the option:
-M[]
--mac --mac={mac|emac|emab_b}
Use this option to enable support for the multiply–accumulate instructions. If you do not
use the option to specify what instruction set to use, the compiler does not support MAC
instructions.
See also the device documentation delivered from the chip manufacturer.
Project>Options>General Options>Target>MAC variant
ACF-1:Final
Assembler options
--mnem_first --mnem_first
The default behavior of the assembler is to treat all identifiers starting in the first column
as labels.
Use this option to make mnemonics names (without a trailing colon) starting in the first
column recognized as mnemonics.
Project>Options>Assembler >Language>Allow mnemonics in first column
--no_div --no_div
Use this option to disable support for the DIVS/DIVU and REMS/REMU instructions.
See also the device documentation delivered from the chip manufacturer.
Project>Options>General Options>Target>No DIV/REM instruction
--no_path_in_file_macros --no_path_in_file_macros
Use this option to exclude the path from the return value of the predefined preprocessor
symbols __FILE__ and __BASE_FILE__.
This option is not available in the IAR Embedded Workbench IDE.
--no_supervisor --no_supervisor
--no_warnings --no_warnings
By default the assembler issues standard warning messages. Use this option to disable
all warning messages.
This option is not available in the IAR Embedded Workbench IDE.
27
ACF-1:Final
Description of assembler options
--no_wrap_diagnostics --no_wrap_diagnostics
By default, long lines in assembler diagnostic messages are broken into several lines to
make the message easier to read. Use this option to disable line wrapping of diagnostic
messages.
This option is not available in the IAR Embedded Workbench IDE.
-o -o {filename|directory}
Example 1
To store the assembler output in a file called obj.r68 in the mypath directory, you
would use:
acf sourcefile -o \mypath\obj
Example 2
If you assemble the file mysource.s68 and want to store the assembler output in a file
mysource.r68 in the working directory, you could use:
acf mysource -o .
Note: Both \ and / can be used as directory delimiters. You must include a space
between the option itself and the filename.
Project>Options>General Options>Output>Output directories>Object files
--only_stdout --only_stdout
Causes the assembler to use stdout also for messages that are normally directed to
stderr.
ACF-1:Final
Assembler options
Use this option to make the compiler include the specified include file before it starts to
read the source file. This is useful if you want to change something in the source code
for the entire application, for instance if you want to define a new symbol.
To set this option, use:
Project>Options>Assembler>Extra Options
Example 1
To store the assembler output with preserved comments to the file output.i, use:
acf sourcefile --preprocess=c output
Example 2
If you assemble the file mysource.s68 and want to store the assembler output with
#line directives to a file mysource.i in the working directory, you could use:
29
ACF-1:Final
Description of assembler options
-r
The --debug option makes the assembler generate debug information that allows a
symbolic debugger such as the IAR C-SPY Debugger to be used on the program.
In order to reduce the size and link time of the object file, the assembler does not
generate debug information by default.
Project>Options>Assembler >Output>Generate debug information
--remarks --remarks
Use this option to make the assembler generate remarks, which is the least severe type
of diagnostic message and which indicates a source code construct that may cause
strange behavior in the generated code. By default remarks are not generated.
See Severity levels, page 109, for additional information about diagnostic messages.
Project>Options>Assembler >Diagnostics>Enable remarks
--silent --silent
The --silent option causes the assembler to operate without sending any messages to
the standard output stream.
By default, the assembler sends various insignificant messages via the standard output
stream. You can use the --silent option to prevent this. The assembler sends error and
warning messages to the error output stream, so they are displayed regardless of this
setting.
This option is not available in the IAR Embedded Workbench IDE.
--warnings_affect_exit_code --warnings_affect_exit_code
By default the exit code is not affected by warnings, only errors produce a non-zero exit
code. With this option, warnings will generate a non-zero exit code.
This option is not available in the IAR Embedded Workbench IDE.
--warnings_are_errors --warnings_are_errors
Use this option to make the assembler treat all warnings as errors. If the assembler
encounters an error, no object code is generated.
ACF-1:Final
Assembler options
If you want to keep some warnings, you can use this option in combination with the
option --diag_warning. First make all warnings become treated as errors and then
reset the ones that should still be treated as warnings, for example:
--diag_warning=As001
31
ACF-1:Final
Description of assembler options
ACF-1:Final
Assembler operators
This chapter first describes the precedence of the assembler operators, and
then summarizes the operators, classified according to their precedence.
Finally, this chapter provides reference information about each operator,
presented in alphabetical order.
Precedence of operators
Each operator has a precedence number assigned to it that determines the order in which
the operator and its operands are evaluated. The precedence numbers range from 1 (the
highest precedence, that is, first evaluated) to 15 (the lowest precedence, that is, last
evaluated).
The following rules determine how expressions are evaluated:
● The highest precedence operators are evaluated first, then the second highest
precedence operators, and so on until the lowest precedence operators are evaluated
● Operators of equal precedence are evaluated from left to right in the expression
● Parentheses ( and ) can be used for grouping operators and operands and for
controlling the order in which the expressions are evaluated. For example, the
following expression evaluates to 1:
7/(1+(2*3))
Note: The precedence order in the ColdFire IAR Assembler closely follows the
precedence order of the ANSI C++ standard for operators, where applicable.
33
ACF-1:Final
Summary of assembler operators
PARENTHESIS OPERATOR – 1
() Parenthesis.
FUNCTION OPERATORS – 2
BYTE1 First byte.
BYTE2 Second byte.
BYTE3 Third byte.
BYTE4 Fourth byte.
DATE Current date/time.
HIGH High byte.
HWRD High word.
LOW Low byte.
LWRD Low word.
SFB Segments begin.
SFE Segments end.
SIZEOF Segments size.
UPPER Third byte.
UNARY OPERATORS – 3
+ Unary plus.
BINNOT [~] Bitwise NOT.
NOT [!] Logical NOT.
- Unary minus.
ACF-1:Final
Assembler operators
SHIFT OPERATORS – 6
SHL [<<] Logical shift left.
SHR [>>] Logical shift right.
COMPARISON OPERATORS – 7
GE [>=] Greater than or equal.
GT [>] Greater than.
LE [<=] Less than or equal.
LT [<] Less than.
UGT Unsigned greater than.
ULT Unsigned less than.
EQUIVALENCE OPERATORS – 8
EQ [=] [==] Equal.
NE [<>] [!=] Not equal.
35
ACF-1:Final
Description of assembler operators
CONDITIONAL OPERATOR – 15
?: Conditional operator.
() Parenthesis (1).
Example
1+2*3 → 7
(1+2)*3 → 9
* Multiplication (4).
* produces the product of its two operands. The operands are taken as signed 32-bit
integers and the result is also a signed 32-bit integer.
Example
2*2 → 4
-2*2 → -4
Example
+3 → 3
3*+2 → 6
ACF-1:Final
Assembler operators
+ Addition (5).
The + addition operator produces the sum of the two operands which surround it. The
operands are taken as signed 32-bit integers and the result is also a signed 32-bit integer.
Example
92+19 → 111
-2+2 → 0
-2+-2 → -4
Example
-3 → -3
3*-2 → -6
4--5 → 9
- Subtraction (5).
The subtraction operator produces the difference when the right operand is taken away
from the left operand. The operands are taken as signed 32-bit integers and the result is
also signed 32-bit integer.
Example
92-19 → 73
-2-2 → -4
-2--2 → 0
/ Division (4).
/ produces the integer quotient of the left operand divided by the right operand. The
operands are taken as signed 32-bit integers and the result is also a signed 32-bit integer.
Example
9/2 → 4
-12/3 → -4
9/2*6 → 24
37
ACF-1:Final
Description of assembler operators
The result of this operator is the first expr if condition evaluates to true and the
second expr if condition evaluates to false.
Note: The question mark and a following label must be separated by space or a tab,
otherwise the ? will be considered the first character of the label.
Syntax
condition ? expr : expr
Example
5 ? 6 : 7 →6
0 ? 6 : 7 →7
Use AND to perform logical AND between its two integer operands. If both operands are
non-zero the result is 1 (true), otherwise it will be 0 (false).
Example
1010B AND 0011B → 1
1010B AND 0101B → 1
1010B AND 0000B → 0
Use BINAND to perform bitwise AND between the integer operands. Each bit in the
32-bit result is the logical AND of the corresponding bits in the operands.
Example
1010B BINAND 0011B → 0010B
1010B BINAND 0101B → 0000B
1010B BINAND 0000B → 0000B
Use BINNOT to perform bitwise NOT on its operand. Each bit in the 32-bit result is the
complement of the corresponding bit in the operand.
ACF-1:Final
Assembler operators
Example
BINNOT 1010B → 11111111111111111111111111110101B
Use BINOR to perform bitwise OR on its operands. Each bit in the 32-bit result is the
inclusive OR of the corresponding bits in the operands.
Example
1010B BINOR 0101B → 1111B
1010B BINOR 0000B → 1010B
Use BINXOR to perform bitwise XOR on its operands. Each bit in the 32-bit result is the
exclusive OR of the corresponding bits in the operands.
Example
1010B BINXOR 0101B → 1111B
1010B BINXOR 0011B → 1001B
BYTE1 takes a single operand, which is interpreted as an unsigned 32-bit integer value.
The result is the low byte (bits 7 to 0) of the operand.
Example
BYTE1 0x12345678 → 0x78
BYTE2 takes a single operand, which is interpreted as an unsigned 32-bit integer value.
The result is the middle-low byte (bits 15 to 8) of the operand.
Example
BYTE2 0x12345678 → 0x56
39
ACF-1:Final
Description of assembler operators
BYTE3 takes a single operand, which is interpreted as an unsigned 32-bit integer value.
The result is the middle-high byte (bits 23 to 16) of the operand.
Example
BYTE3 0x12345678 → 0x34
BYTE4 takes a single operand, which is interpreted as an unsigned 32-bit integer value.
The result is the high byte (bits 31 to 24) of the operand.
Example
BYTE4 0x12345678 → 0x12
Use the DATE operator to specify when the current assembly began.
The DATE operator takes an absolute argument (expression) and returns:
Example
To assemble the date of assembly:
today: DC8 DATE 5, DATE 4, DATE 3
= evaluates to 1 (true) if its two operands are identical in value, or to 0 (false) if its two
operands are not identical in value.
ACF-1:Final
Assembler operators
Example
1 = 2 → 0
2 == 2 → 1
'ABC' = 'ABCD' → 0
>= evaluates to 1 (true) if the left operand is equal to or has a higher numeric value than
the right operand, otherwise it will be 0 (false).
Example
1 >= 2 → 0
2 >= 1 → 1
1 >= 1 → 1
> evaluates to 1 (true) if the left operand has a higher numeric value than the right
operand, otherwise it will be 0 (false).
Example
-1 > 1 → 0
2 > 1 → 1
1 > 1 → 0
HIGH takes a single operand to its right which is interpreted as an unsigned, 16-bit
integer value. The result is the unsigned 8-bit integer value of the higher order byte of
the operand.
Example
HIGH 0xABCD → 0xAB
HWRD takes a single operand, which is interpreted as an unsigned, 32-bit integer value.
The result is the high word (bits 31 to 16) of the operand.
41
ACF-1:Final
Description of assembler operators
Example
HWRD 0x12345678 → 0x1234
<= evaluates to 1 (true) if the left operand has a lower or equal numeric value to the right
operand, otherwise it will be 0 (false).
Example
1 <= 2 → 1
2 <= 1 → 0
1 <= 1 → 1
LOW takes a single operand, which is interpreted as an unsigned, 32-bit integer value.
The result is the unsigned, 8-bit integer value of the lower order byte of the operand.
Example
LOW 0xABCD → 0xCD
< evaluates to 1 (true) if the left operand has a lower numeric value than the right
operand, otherwise it will be 0 (false).
Example
-1 < 2 → 1
2 < 1 → 0
2 < 2 → 0
LWRD takes a single operand, which is interpreted as an unsigned, 32-bit integer value.
The result is the low word (bits 15 to 0) of the operand.
Example
LWRD 0x12345678 → 0x5678
ACF-1:Final
Assembler operators
MOD produces the remainder from the integer division of the left operand by the right
operand. The operands are taken as signed 32-bit integers and the result is also a signed
32-bit integer.
X MOD Y is equivalent to X-Y*(X/Y) using integer division.
Example
2 MOD 2 → 0
12 MOD 7 → 5
3 MOD 2 → 1
<> evaluates to 0 (false) if its two operands are identical in value or to 1 (true) if its two
operands are not identical in value.
Example
1 <> 2 → 1
2 <> 2 → 0
'A' <> 'B' → 1
Example
NOT 0101B → 0
NOT 0000B → 1
Example
1010B OR 0000B → 1
0000B OR 0000B → 0
43
ACF-1:Final
Description of assembler operators
SFB accepts a single operand to its right. The operand must be the name of a relocatable
segment. The operator evaluates to the absolute address of the first byte of that segment.
This evaluation takes place at link time.
Syntax
SFB(segment [{+|-}offset])
Parameters
segment The name of a relocatable segment, which must be defined before
SFB is used.
offset An optional offset from the start address. The parentheses are
optional if offset is omitted.
Example
NAME demo
RSEG segtab:CONST
start: DC16 SFB(mycode)
Even if the above code is linked with many other modules, start will still be set to the
address of the first byte of the segment.
SFE accepts a single operand to its right. The operand must be the name of a relocatable
segment. The operator evaluates to the segment start address plus the segment size. This
evaluation takes place at link time.
Syntax
SFE (segment [{+ | -} offset])
Parameters
segment The name of a relocatable segment, which must be defined before
SFE is used.
offset An optional offset from the start address. The parentheses are
optional if offset is omitted.
ACF-1:Final
Assembler operators
Example
NAME demo
RSEG segtab:CONST
end: DC16 SFE(mycode)
Even if the above code is linked with many other modules, end will still be set to the
first byte after that segment (mycode).
The size of the segment MY_SEGMENT can be calculated as:
SFE(MY_SEGMENT)-SFB(MY_SEGMENT)
Use SHL to shift the left operand, which is always treated as unsigned, to the left. The
number of bits to shift is specified by the right operand, interpreted as an integer value
between 0 and 32.
Example
00011100B SHL 3 → 11100000B
00000111111111111B SHL 5 → 11111111111100000B
14 SHL 1 → 28
Use SHR to shift the left operand, which is always treated as unsigned, to the right. The
number of bits to shift is specified by the right operand, interpreted as an integer value
between 0 and 32.
Example
01110000B SHR 3 → 00001110B
1111111111111111B SHR 20 → 0
14 SHR 1 → 7
SIZEOF generates SFE-SFB for its argument, which should be the name of a relocatable
segment; that is, it calculates the size in bytes of a segment. This is done when modules
are linked together.
Syntax
SIZEOF (segment)
45
ACF-1:Final
Description of assembler operators
Parameters
segment The name of a relocatable segment, which must be defined before
SIZEOF is used.
Example
The following code sets size to the size of the segment mycode.
MODULE table
RSEG mycode:CODE ;forward declaration of mycode
RSEG segtab:CONST
size: DC32 SIZEOF(mycode)
ENDMOD
MODULE application
RSEG mycode:CODE
NOP ;placeholder for application code
ENDMOD
UGT evaluates to 1 (true) if the left operand has a larger value than the right operand,
otherwise it will be 0 (false). The operation treats its operands as unsigned values.
Example
2 UGT 1 → 1
-1 UGT 1 → 1
ULT evaluates to 1 (true) if the left operand has a smaller value than the right operand,
otherwise it will be 0 (false). The operation treats the operands as unsigned values.
Example
1 ULT 2 → 1
-1 ULT 2 → 0
UPPER takes a single operand, which is interpreted as an unsigned 32-bit integer value.
The result is the middle-high byte (bits 23 to 16) of the operand.
ACF-1:Final
Assembler operators
Example
UPPER 0x12345678 → 0x34
XOR evaluates to 1 (true) if either the left operand or the right operand is non-zero, but
to 0 (false) if both operands are zero or both are non-zero. Use XOR to perform logical
XOR on its two operands.
Example
0101B XOR 1010B → 0
0101B XOR 0000B → 1
47
ACF-1:Final
Description of assembler operators
ACF-1:Final
Assembler directives
This chapter gives an alphabetical summary of the assembler directives and
provides detailed reference information for each category of directives.
49
ACF-1:Final
Summary of assembler directives
ACF-1:Final
Assembler directives
51
ACF-1:Final
Summary of assembler directives
ACF-1:Final
Assembler directives
SYNTAX
END [address]
ENDMOD [address]
LIBRARY symbol [(expr)]
MODULE symbol [(expr)]
53
ACF-1:Final
Module control directives
PARAMETERS
address An optional expression that determines the start address of the program.
It can take any positive integer value.
expr An optional expression used by the compiler to encode the runtime
options. It must be within the range 0-255 and evaluate to a constant
value. The expression is only meaningful if you are assembling source
code that originates as assembler output from the compiler.
key A text string specifying the key.
symbol Name assigned to module, used by XLINK, XAR, and XLIB when
processing object files.
value A text string specifying the value.
DESCRIPTIONS
Terminating a module
Use ENDMOD to define the end of a module.
ACF-1:Final
Assembler directives
55
ACF-1:Final
Symbol control directives
Examples
The following example defines three modules where:
● MOD_1 and MOD_2 cannot be linked together since they have different values for
runtime model foo.
● MOD_1 and MOD_3 can be linked together since they have the same definition of
runtime model bar and no conflict in the definition of foo.
● MOD_2 and MOD_3 can be linked together since they have no runtime model
conflicts. The value * matches any runtime model value.
MODULE MOD_1
RTMODEL "foo", "1"
RTMODEL "bar", "XXX"
...
ENDMOD
MODULE MOD_2
RTMODEL "foo", "2"
RTMODEL "bar", "*"
...
ENDMOD
MODULE MOD_3
RTMODEL "bar", "XXX"
...
END
ACF-1:Final
Assembler directives
SYNTAX
label BLOCK old_label, block_number
EXTERN symbol [,symbol] …
IMPORT symbol [,symbol] …
PUBLIC symbol [,symbol] …
PUBWEAK symbol [,symbol] …
REQUIRE symbol
label SYMBOL "C/C++_symbol" [,old_label]
PARAMETERS
block_number Block number of the alias created by the SYMBOL directive.
C/C++_symbol C/C++ symbol to create an alias for.
label Label to be used as an alias for a C/C++ symbol.
old_label Alias created earlier by a SYMBOL directive.
symbol Symbol to be imported or exported.
DESCRIPTIONS
57
ACF-1:Final
Symbol control directives
Note: Library modules are only linked if a reference to a symbol in that module is made,
and that symbol has not already been linked. During the module selection phase, no
distinction is made between PUBLIC and PUBWEAK definitions. This means that to
ensure that the module containing the PUBLIC definition is selected, you should link it
before the other modules, or make sure that a reference is made to some other PUBLIC
symbol in that module.
Importing symbols
Use EXTERN or IMPORT to import an untyped external symbol.
The REQUIRE directive marks a symbol as referenced. This is useful if the segment part
containing the symbol must be loaded for the code containing the reference to work, but
the dependence is not otherwise evident.
EXAMPLES
The following example defines a subroutine to print an error message, and exports the
entry address err so that it can be called from other modules.
Because the message is enclosed in double quotes, the string will be followed by a zero
byte.
It defines print as an external routine; the address will be resolved at link time.
NAME error
EXTERN print
PUBLIC err
RSEG CODE
ACF-1:Final
Assembler directives
SYNTAX
ALIGN align [,value]
ALIGNRAM align
ASEG [start]
ASEGN segment [:type], address
COMMON segment [:type] [(align)]
EVEN [value]
ODD [value]
ORG expr
RSEG segment [:type] [flag] [(align)]
59
ACF-1:Final
Segment control directives
PARAMETERS
address Address where this segment part will be placed.
align The power of two to which the address should be aligned, in most
cases in the range 0 to 30.
The default align value is 0, except for code segments where the
default is 1.
expr Address to set the location counter to.
flag NOROOT, ROOT
NOROOT means that the segment part is discarded by the linker if no
symbols in this segment part are referred to. Normally, all segment
parts except startup code and interrupt vectors should set this flag.
The default mode is ROOT which indicates that the segment part must
not be discarded.
REORDER, NOREORDER
REORDER allows the linker to reorder segment parts. For a given
segment, all segment parts must specify the same state for this flag.
The default mode is NOREORDER which indicates that the segment
parts must remain in order.
SORT, NOSORT
SORT means that the linker will sort the segment parts in decreasing
alignment order. For a given segment, all segment parts must specify
the same state for this flag. The default mode is NOSORT which
indicates that the segment parts will not be sorted.
segment The name of the segment.
start A start address that has the same effect as using an ORG directive at
the beginning of the absolute segment.
type The memory type, typically CODE or DATA. In addition, any of the
types supported by the IAR XLINK Linker.
value Byte value used for padding, default is zero.
DESCRIPTIONS
ACF-1:Final
Assembler directives
If the parameter is omitted, the start address of the first segment is 0, and subsequent
segments continue after the last address of the previous segment.
61
ACF-1:Final
Segment control directives
Aligning a segment
Use ALIGN to align the program location counter to a specified address boundary. The
expression gives the power of two to which the program counter should be aligned and
the permitted range is 0 to 8.
The alignment is made relative to the segment start; normally this means that the
segment alignment must be at least as large as that of the alignment directive to give the
desired result.
ALIGN aligns by inserting zero/filled bytes, up to a maximum of 255. The EVEN directive
aligns the program counter to an even address (which is equivalent to ALIGN 1) and the
ODD directive aligns the program location counter to an odd address. The byte value for
padding must be within the range 0 to 255.
Use ALIGNRAM to align the program location counter by incrementing it; no data is
generated. The expression can be within the range 0 to 30.
EXAMPLES
MODULE reset
EXTERN main
ASEG
ORG 0 ; RESET vector address
end
RSEG table
ACF-1:Final
Assembler directives
functable:
DC32 subrtn, divrtn
RSEG code
main:
MOWE.L #0x12, D0
ADD.L #0x20, D0
RTS
END
Because the common segments have the same name, data, the variables up and down
refer to the same locations in memory as the first and last bytes of the 4-byte variable
count.
Aligning a segment
This example starts a relocatable segment, moves to an even address, and adds some
data. It then aligns to a 64-byte boundary before creating a 64-byte table.
RSEG data ; Start a relocatable datasegment
EVEN ; Ensure it’s on an even boundary
target DC16 1 ; target and best will be on an
; even boundary
best DC16 1
ALIGN 6 ; Now align to a 64 byte boundary
results DS8 64 ; And create a 64 byte table
END
63
ACF-1:Final
Value assignment directives
SYNTAX
label = expr
label ASSIGN expr
label DEFINE const_expr
label EQU expr
LIMIT expr, min, max, message
label SET expr
label VAR expr
PARAMETERS
const_expr Constant value assigned to symbol.
expr Value assigned to symbol or value to be tested.
label Symbol to be defined.
message A text message that will be printed when expr is out of range.
min, max The minimum and maximum values allowed for expr.
DESCRIPTIONS
ACF-1:Final
Assembler directives
EXAMPLES
Redefining a symbol
The following example uses SET to redefine the symbol cons in a loop to generate a
table of the first 8 powers of 3:
NAME table
cons SET 1
65
ACF-1:Final
Value assignment directives
cr_tabl times-1
ENDIF
ENDM
RSEG CODE
table cr_tabl 4
END table
ACF-1:Final
Assembler directives
NAME add2
PUBLIC add20
value EQU 20
RSEG CODE
add20:
MOVE.L #R0, D0
ADD.L #value, D0
RTS
END
67
ACF-1:Final
Conditional assembly directives
SYNTAX
ELSE
ELSEIF condition
ENDIF
IF condition
PARAMETERS
condition One of the following:
An absolute expression The expression must not contain
forward or external references, and
any non-zero value is considered as
true.
string1==string2 The condition is true if string1 and
string2 have the same length and
contents.
string1!=string2 The condition is true if string1 and
string2 have different length or
contents.
ACF-1:Final
Assembler directives
DESCRIPTIONS
Use the IF, ELSE, and ENDIF directives to control the assembly process at assembly
time. If the condition following the IF directive is not true, the subsequent instructions
will not generate any code (that is, it will not be assembled or syntax checked) until an
ELSE or ENDIF directive is found.
EXAMPLES
The following macro adds a constant to a byte variable in memory:
xadd MACRO a ,b ; a is a register, D0-D7,
; b is a literal
IF b == 1
ADDQ.L #1, a
ELSE
ADD.L #b, a
ENDIF
ENDM
END
69
ACF-1:Final
Macro processing directives
SYNTAX
_args
ENDM
ENDR
EXITM
LOCAL symbol [,symbol] …
name MACRO [argument] [,argument] …
REPT expr
REPTC formal,actual
REPTI formal,actual [,actual] …
PARAMETERS
actual A string to be substituted.
argument A symbolic argument name.
expr An expression.
ACF-1:Final
Assembler directives
DESCRIPTIONS
A macro is a user-defined symbol that represents a block of one or more assembler
source lines. Once you have defined a macro you can use it in your program like an
assembler directive or assembler mnemonic.
When the assembler encounters a macro, it looks up the macro’s definition, and inserts
the lines that the macro represents as if they were included in the source file at that
position.
Macros perform simple text substitution effectively, and you can control what they
substitute by supplying parameters to them.
Defining a macro
You define a macro with the statement:
name MACRO [argument] [,argument] …
Here name is the name you are going to use for the macro, and argument is an argument
for values that you want to pass to the macro when it is expanded.
For example, you could define a macro ERROR as follows:
errmac MACRO text
JSR abort
DB text,0
EVEN
ENDM
This macro uses a parameter text to set up an error message for a routine abort. You
would call the macro with a statement such as:
errmac 'Disk not ready'
If you omit a list of one or more arguments, the arguments you supply when calling the
macro are called \1 to \9 and \A to \Z.
71
ACF-1:Final
Macro processing directives
Use LOCAL to create symbols local to a macro. The LOCAL directive must be used before
the symbol is used.
Each time that a macro is expanded, new instances of local symbols are created by the
LOCAL directive. Therefore, it is legal to use local symbols in recursive macros.
You can redefine the macro quote characters with the -M command line option; see -M,
page 26.
ACF-1:Final
Assembler directives
ELSE
DC8 \1
ENDIF
ENDM
RSEG CODE
FILL 3, 4
FILL 3
END
73
ACF-1:Final
Macro processing directives
2 A macro call forces the assembler to invoke the macro processor (expander). The
macro expander switches (if not already in a macro) the assembler input stream
from a source file to the output from the macro expander. The macro expander takes
its input from the requested macro definition.
The macro expander has no knowledge of assembler symbols since it only deals with
text substitutions at source level. Before a line from the called macro definition is
handed over to the assembler, the expander scans the line for all occurrences of
symbolic macro arguments, and replaces them with their expansion arguments.
3 The expanded line is then processed as any other assembler source line. The input
stream to the assembler will continue to be the output from the macro processor,
until all lines of the current macro definition have been read.
Repeating statements
Use the REPT...ENDR structure to assemble the same block of instructions a number of
times. If expr evaluates to 0 nothing will be generated.
Use REPTC to assemble a block of instructions once for each character in a string. If the
string contains a comma it should be enclosed in quotation marks.
Only double quotes have a special meaning and their only use is to enclose the
characters to iterate over. Single quotes have no special meaning and are treated as any
ordinary character.
Use REPTI to assemble a block of instructions once for each string in a series of strings.
Strings containing commas should be enclosed in quotation marks.
EXAMPLES
This section gives examples of the different ways in which macros can make assembler
programming easier.
ACF-1:Final
Assembler directives
RSEG CSTACK
P0 DEFINE 0xFF8010
RSEG DATA
buffer DS8 25
watch DC8 0xFF
RSEG CODE
play MOVEA.L #buffer, A0
MOVE.B (buffer, A0), D0
loop ADDQ.L #1, A0
MOVE.B D0, (P0).L
MOVE.B (buffer, A0), D0
CMPI.B #watch, D0
BNE.B loop
RTS
RSEG STACK
play MACRO
LOCAL loop
MOVEA.L #buffer, A0
MOVE.B (buffer, A0), D0
loop ADDQ.L #1, A0
75
ACF-1:Final
Macro processing directives
P0 DEFINE 0xFF8010
RSEG DATA
buffer DS8 25
watch DC8 0xFF
RSEG CODE
main play
play
RTS
END
Notice the use of the LOCAL directive to make the label loop local to the macro;
otherwise an error will be generated if the macro is used twice, as the loop label will
already exist.
ACF-1:Final
Assembler directives
77
ACF-1:Final
Listing control directives
Directive Description
LSTMAC Controls the listing of macro definitions.
LSTOUT Controls assembly-listing output.
LSTREP Controls the listing of lines generated by repeat directives.
LSTXRF Generates a cross-reference table.
Table 21: Listing control directives (Continued)
SYNTAX
LSTCND{+|-}
LSTCOD{+|-}
LSTEXP{+|-}
LSTMAC{+|-}
LSTOUT{+|-}
LSTREP{+|-}
LSTXRF{+|-}
DESCRIPTIONS
ACF-1:Final
Assembler directives
Use LSTMAC+ to list macro definitions. The default is LSTMAC-, which disables the
listing of macro definitions.
EXAMPLES
RSEG prom
debug SET 0
begin IF debug
JSR (print).L
ENDIF
LSTCND+
begin2 IF debug
JSR (print).L
ENDIF
END
79
ACF-1:Final
Listing control directives
LSTMAC-
inc2 MACRO arg
MOVE.L (arg).L, D0
ADDQ.L #2, D0
ENDM
EXTERN memlock
begin dec2 memlock
LSTEXP-
inc2 memlock
RTS
END
ACF-1:Final
Assembler directives
6 ENDM
7
8 LSTMAC-
13
14 000000 EXTERN memlock
15 000000 begin dec2 memlock
15.1 000000 2039........ MOVE.L (memlock).L, D0
15.2 000006 5580 SUBQ.L #2, D0
16 LSTEXP-
17 000008 inc2 memlock
18 000010 4E75 RTS
19 000012 END
SYNTAX
#define symbol text
#elif condition
#else
81
ACF-1:Final
C-style preprocessor directives
#endif
#error "message"
#if condition
#ifdef symbol
#ifndef symbol
#include {"filename" | <filename>}
#undef symbol
PARAMETERS
condition An absolute expression The expression must not
contain any assembler labels or
symbols, and any non-zero
value is considered as true.
filename Name of file to be included.
message Text to be displayed.
symbol Preprocessor symbol to be defined,
undefined, or tested.
text Value to be assigned.
DESCRIPTIONS
It is important to avoid mixing the assembler language with the C-style preprocessor
directives. Conceptually, they are different languages and mixing them may lead to
unexpected behavior because an assembler directive is not necessarily accepted as a part
of the C preprocessor language.
Note that the preprocessor directives are processed before other directives. As an
example avoid constructs like:
redef macro ; avoid the following
#define \1 \2
endm
because the \1 and \2 macro arguments will not be available during the preprocessing
phase.
ACF-1:Final
Assembler directives
Use #undef to undefine a symbol; the effect is as if it had not been defined.
All assembler directives (except for END) and file inclusion may be disabled by the
conditional directives. Each #if directive must be terminated by a #endif directive.
The #else directive is optional and, if used, it must be inside a #if...#endif block.
#if...#endif and #if...#else...#endif blocks may be nested to any level.
Use #ifdef to assemble instructions up to the next #else or #endif directive only if
a symbol is defined.
Use #ifndef to assemble instructions up to the next #else or #endif directive only if
a symbol is undefined.
83
ACF-1:Final
C-style preprocessor directives
Use angle brackets for header files provided with the ColdFire IAR Assembler, and
double quotes for header files that are part of your application.
Displaying errors
Use #error to force the assembler to generate an error, such as in a user-defined test.
The following example illustrates some problems that might occur when assembler
comments are used in the C-style preprocessor:
#define five 5 ; this comment is not OK
#define six 6 // this comment is OK
#define seven 7 /* this comment is OK */
DC32 five,11,12
; Expands to "DC32 5 ; this comment is not OK"
EXAMPLES
#ifdef tweak
#if adjust==1
SUB.L #4, D0
ACF-1:Final
Assembler directives
#elif adjust==2
SUB.L #20, D0
#elif adjust==3
SUB.L #30, D0
#endif
#endif /* ifdef tweak */
The macro definitions can then be included, using #include, as in the following
example:
NAME include
#include "macros.s68"
; program
main:
xch D0,D1,D2
RTS
END main
85
ACF-1:Final
Data definition or allocation directives
SYNTAX
DB expr [,expr] …
DC8 expr [,expr] ...
DC16 expr [,expr] ...
DC24 expr [,expr] ...
DC32 expr [,expr] ...
DC64 expr [,expr] ...
expr [,expr] …
expr [,expr] …
expr [,expr] …
value [,value] …
value [,value] …DF value [,value] …
DF32 value [,value] …
DF64 value [,value] …
DQ15 value [,value] …
DQ31 value [,value] …
DS count
DS8 count
DS16 count
DS24 count
DS32 count
ACF-1:Final
Assembler directives
DS64 count
DW expr [,expr] …
PARAMETERS
count A valid absolute expression specifying the number of elements to be
reserved.
expr A valid absolute, relocatable, or external expression, or an ASCII string.
ASCII strings will be zero filled to a multiple of the data size implied by
the directive. Double-quoted strings will be zero-terminated.*
value A valid absolute expression or floating-point constant.
* For DC64, the expr cannot be relocatable or external.
DESCRIPTIONS
Use DC8, DC16, DC24, DC32, DC64, DB, DW, DF32, or DF64 to create a constant, which
means an area of bytes is reserved big enough for the constant.
Use DS, DS8, DS16, DS24, DS32, or DS64, to reserve a number of uninitialized bytes.
EXAMPLES
PUBLIC fsum
RSEG CODE
table: DC8 12
DC8 15
DC8 17
DC8 16
DC8 14
DC8 11
DC8 9
RSEG CODE
COUNT SET 0
87
ACF-1:Final
Assembler control directives
fsum:
CLR.L D0
CLR.L D7
REPT 7
IF COUNT == 7
EXITM
ENDIF
MOVE.B (table+COUNT).L, D0
ADD.L D0, D7
COUNT SET COUNT+1
ENDR
MOVE.B D7, D0 ; Get sum into D0
RTS
END
Defining strings
To define a string:
myMsg DC8 'Please enter your name'
Reserving space
To reserve space for 10 bytes:
table DS8 10
ACF-1:Final
Assembler directives
SYNTAX
/*comment*/
//comment
CASEOFF
CASEON
RADIX expr
PARAMETERS
comment Comment ignored by the assembler.
expr Default base; default 10 (decimal).
DESCRIPTIONS
Use /*...*/ to comment sections of the assembler listing.
Use // to mark the rest of the line as comment.
Use RADIX to set the default base for constants. The default base is 10.
EXAMPLES
Defining comments
The following example shows how /*...*/ can be used for a multi-line comment:
/*
Program to read serial input.
89
ACF-1:Final
Function directives
Version 1: 19.2.07
Author: mjp
*/
The immediate argument will then be interpreted as the hexadecimal constant 12, that is
decimal 18.
To reset the base from 16 to 10 again, the argument must be written in hexadecimal
format, for example:
RADIX 0x0A
CASEOFF
label NOP
LABEL NOP ; Error, "LABEL" already defined
END
Function directives
The function directives are generated by the ColdFire IAR C/C++ Compiler to pass
information about functions and function calls to the IAR XLINK Linker. These
directives can be seen if you create an assembler list file by using the compiler option
Output assembler file>Include compiler runtime information (-lA).
Note: These directives are primarily intended to support static overlay, a feature which
is useful in smaller microcontrollers. The ColdFire IAR C/C++ Compiler does not use
static overlay, as it has no use for it.
ACF-1:Final
Assembler directives
SYNTAX
ARGFRAME segment, size, type
FUNCALL caller, callee
FUNCTION label,value
LOCFRAME segment, size, type
PARAMETERS
callee The called function.
DESCRIPTIONS
FUNCTION declares the label name to be a function. value encodes extra information
about the function.
FUNCALL declares that the function caller calls the function callee. callee can be
omitted to indicate an indirect function call.
ARGFRAME and LOCFRAME declare how much space the frame of the function uses in
different memories. ARGFRAME declares the space used for the arguments to the
function, LOCFRAME the space for locals. segment is the segment in which the space
resides. size is the number of bytes used. type is either STACK or STATIC, for
stack-based allocation and static overlay allocation, respectively.
ARGFRAME and LOCFRAME always occur immediately after a FUNCTION or FUNCALL
directive.
After a FUNCTION directive for an external function, there can only be ARGFRAME
directives, which indicate the maximum argument frame usage of any call to that
function. After a FUNCTION directive for a defined function, there can be both
ARGFRAME and LOCFRAME directives.
After a FUNCALL directive, there will first be LOCFRAME directives declaring frame
usage in the calling function at the point of call, and then ARGFRAME directives
declaring argument frame usage of the called function.
91
ACF-1:Final
Call frame information directives
ACF-1:Final
Assembler directives
SYNTAX
The syntax definitions below show the syntax of each directive. The directives are
grouped according to usage.
93
ACF-1:Final
Call frame information directives
PARAMETERS
bits The size of the resource in bits.
cell The name of a frame cell.
cfa The name of a CFA (canonical frame address).
cfiexpr A CFI expression (see CFI expressions, page 101).
codealignfactor The smallest factor of all instruction sizes. Each CFI directive for
a data block must be placed according to this alignment. 1 is the
default and can always be used, but a larger value will shrink the
produced backtrace information in size. The possible range is
1–256.
commonblock The name of a previously defined common block.
constant A constant value or an assembler expression that can be evaluated
to a constant value.
dataalignfactor The smallest factor of all frame sizes. If the stack grows towards
higher addresses, the factor is negative; if it grows towards lower
addresses, the factor is positive. 1 is the default, but a larger value
will shrink the produced backtrace information in size. The
possible ranges are -256 to -1 and 1 to 256.
label A function label.
name The name of the block.
ACF-1:Final
Assembler directives
DESCRIPTIONS
The call frame information directives (CFI directives) are an extension to the debugging
format of the IAR C-SPY® Debugger. The CFI directives are used for defining the
backtrace information for the instructions in a program. The compiler normally
generates this information, but for library functions and other code written purely in
assembler language, backtrace information has to be added if you want to use the call
frame stack in the debugger.
The backtrace information is used to keep track of the contents of resources, such as
registers or memory cells, in the assembler code. This information is used by the IAR
C-SPY Debugger to go “back” in the call stack and show the correct values of registers
or other resources before entering the function. In contrast with traditional approaches,
this permits the debugger to run at full speed until it reaches a breakpoint, stop at the
breakpoint, and retrieve backtrace information at that point in the program. The
information can then be used to compute the contents of the resources in any of the
calling functions—assuming they have call frame information as well.
95
ACF-1:Final
Call frame information directives
There is always exactly one return address column and usually only one CFA column,
although there may be more than one.
ACF-1:Final
Assembler directives
The parameters are the name of the CFA and the name of the segment where the static
overlay for the function is located. More than one static overlay frame CFA can be
declared by separating them with commas.
● To declare a base address CFA, use the directive:
CFI BASEADDRESS cfa type
The parameters are the name of the CFA and the segment type. More than one base
address CFA can be declared by separating them with commas.
A base address CFA is used to conveniently handle a CFA. In contrast to the stack
frame CFA, there is no associated stack pointer resource to restore.
where namesblock is the name of the existing names block and name is the name of
the new extended block. The extended block must end with the directive:
CFI ENDNAMES name
where name is the name of the new block and namesblock is the name of a previously
defined names block.
Declare the return address column with the directive:
CFI RETURNADDRESS resource type
where resource is a resource defined in namesblock and type is the segment type.
You have to declare the return address column for the common block.
End a common block with the directive:
CFI ENDCOMMON name
97
ACF-1:Final
Call frame information directives
where name is the name of the new extended block, commonblock is the name of the
existing common block, and namesblock is the name of a previously defined names
block. The extended block must end with the directive:
CFI ENDCOMMON name
where name is the name of the new block and commonblock is the name of a previously
defined common block.
If the piece of code is part of a defined function, specify the name of the function with
the directive:
CFI FUNCTION label
ACF-1:Final
Assembler directives
SIMPLE RULES
To describe the tracking information for individual columns, there is a set of simple rules
with specialized syntax:
CFI cfa { NOTUSED | USED }
CFI cfa { resource | resource + constant | resource - constant }
CFI resource { UNDEFINED | SAMEVALUE | CONCAT }
CFI resource { resource | FRAME(cfa, offset) }
These simple rules can be used both in common blocks to describe the initial
information for resources and CFAs, and inside data blocks to describe changes to the
information for resources or CFAs.
In those rare cases where the descriptive power of the simple rules are not enough, a full
CFI expression can be used to describe the information (see CFI expressions, page 101).
However, whenever possible, you should always use a simple rule instead of a CFI
expression.
There are two different sets of simple rules: one for resources and one for CFAs.
To declare that a resource is not tracked, use UNDEFINED as location. Conceptually, this
declares that the resource does not have to be restored (when going back one call frame)
since it is not tracked. Usually it is only meaningful to use it to declare the initial location
of a resource. For example, to declare that REG is a scratch register and does not have to
be restored, use the directive:
CFI REG UNDEFINED
99
ACF-1:Final
Call frame information directives
To declare that a resource is temporarily stored in another resource, use the resource
name as its location. For example, to declare that a register REG1 is temporarily located
in a register REG2 (and should be restored from that register), use the directive:
CFI REG1 REG2
To declare that a resource is currently located somewhere on the stack, use FRAME(cfa,
offset) as location for the resource, where cfa is the CFA identifier to use as “frame
pointer” and offset is an offset relative the CFA. For example, to declare that a register
REG is located at offset -4 counting from the frame pointer CFA_SP, use the directive:
For a composite resource there is one additional location, CONCAT, which declares that
the location of the resource can be found by concatenating the resource parts for the
composite resource. For example, consider a composite resource RET with resource
parts RETLO and RETHI. To declare that the value of RET can be found by investigating
and concatenating the resource parts, use the directive:
CFI RET CONCAT
This requires that at least one of the resource parts has a definition, using the rules
described above.
To declare that a CFA has an address that is offset relative the value of a resource, specify
the resource and the offset. For example, to declare that the CFA with the name CFA_SP
can be obtained by adding 4 to the value of the SP resource, use the directive:
CFI CFA_SP SP + 4
ACF-1:Final
Assembler directives
For static overlay frame CFAs, there are only two possible declarations inside common
and data blocks: USED and NOTUSED.
CFI EXPRESSIONS
Call frame information expressions (CFI expressions) can be used when the descriptive
power of the simple rules for resources and CFAs is not enough. However, you should
always use a simple rule when one is available.
CFI expressions consist of operands and operators. Only the operators described below
are allowed in a CFI expression. In most cases, they have an equivalent operator in the
regular assembler expressions.
In the operand descriptions, cfiexpr denotes one of the following:
● A CFI operator with operands
● A numeric constant
● A CFA name
● A resource name.
Unary operators
Overall syntax: OPERATOR(operand)
Operator Operand Description
COMPLEMENT cfiexpr Performs a bitwise NOT on a CFI expression.
LITERAL expr Get the value of the assembler expression. This can insert
the value of a regular assembler expression into a CFI
expression.
NOT cfiexpr Negates a logical CFI expression.
UMINUS cfiexpr Performs arithmetic negation on a CFI expression.
Table 26: Unary operators in CFI expressions
Binary operators
Overall syntax: OPERATOR(operand1,operand2)
Operator Operands Description
ADD cfiexpr,cfiexpr Addition
AND cfiexpr,cfiexpr Bitwise AND
DIV cfiexpr,cfiexpr Division
EQ cfiexpr,cfiexpr Equal
Table 27: Binary operators in CFI expressions
101
ACF-1:Final
Call frame information directives
Ternary operators
Overall syntax: OPERATOR(operand1,operand2,operand3)
Operator Operands Description
FRAME cfa,size,offset Gets the value from a stack frame. The operands are:
cfa An identifier denoting a previously declared CFA.
size A constant expression denoting a size in bytes.
offset A constant expression denoting an offset in
bytes.
Gets the value at address cfa+offset of size size.
Table 28: Ternary operators in CFI expressions
ACF-1:Final
Assembler directives
EXAMPLE
The following is a generic example and not an example specific to the ColdFire
microcontroller. This will simplify the example and clarify the usage of the CFI
directives. A target-specific example can be obtained by generating assembler output
when compiling a C source file.
Consider a generic processor with a stack pointer SP, and two registers R0 and R1.
Register R0 will be used as a scratch register (the register is destroyed by the function
call), whereas register R1 has to be restored after the function call. For reasons of
simplicity, all instructions, registers, and addresses will have a width of 16 bits.
Consider the following short code sample with the corresponding backtrace rows and
columns. At entry, assume that the stack contains a 16-bit return address. The stack
grows from high addresses towards zero. The CFA denotes the top of the call frame, that
is, the value of the stack pointer after returning from the function.
Address CFA SP R0 R1 RET Assembler code
0000 SP + 2 — SAME CFA - 2 func1: PUSH R1
0002 SP + 4 CFA - 4 MOV R1,#4
0004 CALL func2
0006 POP R0
0008 SP + 2 R0 MOV R1,R0
000A SAME RET
Table 29: Code sample with backtrace rows and columns
103
ACF-1:Final
Call frame information directives
Each backtrace row describes the state of the tracked resources before the execution of
the instruction. As an example, for the MOV R1,R0 instruction the original value of the
R1 register is located in the R0 register and the top of the function frame (the CFA
column) is SP + 2. The backtrace row at address 0000 is the initial row and the result
of the calling convention used for the function.
The SP column is empty since the CFA is defined in terms of the stack pointer. The RET
column is the return address column—that is, the location of the return address. The R0
column has a ‘—’ in the first line to indicate that the value of R0 is undefined and does
not need to be restored on exit from the function. The R1 column has SAME in the initial
row to indicate that the value of the R1 register will be restored to the same value it
already has.
Note: SP may not be changed using a CFI directive since it is the resource associated
with CFA.
ACF-1:Final
Assembler directives
func1:
PUSH R1
CFI CFA SP + 4
CFI R1 FRAME(CFA,-4)
MOV R1,#4
CALL func2
POP R0
CFI R1 R0
CFI CFA SP + 2
MOV R1,R0
CFI R1 SAMEVALUE
RET
CFI ENDBLOCK func1block
Note that the CFI directives are placed after the instruction that affects the backtrace
information.
105
ACF-1:Final
Call frame information directives
ACF-1:Final
Pragma directives
This chapter describes the pragma directives of the ColdFire IAR Assembler.
The pragma directives control the behavior of the assembler, for example
whether it outputs warning messages. The pragma directives are
preprocessed, which means that macros are substituted in a pragma directive.
or
#pragma pragmaname = pragmavalue
Changes the severity level back to default or as defined on the command line for the
diagnostic messages with the specified tags. For example:
#pragma diag_default=Pe117
See the chapter Diagnostics for more information about diagnostic messages.
107
ACF-1:Final
Descriptions of pragma directives
Changes the severity level to error for the specified diagnostics. For example:
#pragma diag_error=Pe117
See the chapter Diagnostics for more information about diagnostic messages.
Changes the severity level to remark for the specified diagnostics. For example:
#pragma diag_remark=Pe177
See the chapter Diagnostics for more information about diagnostic messages.
Suppresses the diagnostic messages with the specified tags. For example:
#pragma diag_suppress=Pe117,Pe177
See the chapter Diagnostics for more information about diagnostic messages.
Changes the severity level to warning for the specified diagnostics. For example:
#pragma diag_warning=Pe826
See the chapter Diagnostics for more information about diagnostic messages.
Makes the assembler print a message on stdout when the file is assembled. For
example:
#ifdef TESTING
#pragma message("Testing")
#endif
ACF-1:Final
Diagnostics
This chapter describes the format of the diagnostic messages and explains how
diagnostic messages are divided into different levels of severity.
Message format
All diagnostic messages are issued as complete, self-explanatory messages. A typical
diagnostic message from the assembler is produced in the form:
filename,linenumber level[tag]: message
where filename is the name of the source file in which the error was encountered;
linenumber is the line number at which the assembler detected the error; level is the
level of seriousness of the diagnostic; tag is a unique tag that identifies the diagnostic
message; message is a self-explanatory message, possibly several lines long.
Diagnostic messages are displayed on the screen, as well as printed in the optional list
file. In the IAR Embedded Workbench IDE, diagnostic messages are displayed in the
Build messages window.
Severity levels
The diagnostics are divided into different levels of severity:
Remark
A diagnostic message that is produced when the assembler finds a source code construct
that can possibly lead to erroneous behavior in the generated code. Remarks are by
default not issued but can be enabled, see --remarks, page 30.
Warning
A diagnostic message that is produced when the assembler finds a programming error
or omission which is of concern but not so severe as to prevent the completion of
compilation. Warnings can be disabled by use of the command-line option
--no_warnings, see --no_warnings, page 27.
Error
A diagnostic message that is produced when the assembler has found a construct which
clearly violates the language rules, such that code cannot be produced. An error will
produce a non-zero exit code.
109
ACF-1:Final
Severity levels
Fatal error
A diagnostic message that is produced when the assembler has found a condition that
not only prevents code generation, but which makes further processing of the source
code pointless. After the diagnostic has been issued, compilation terminates. A fatal
error will produce a non-zero exit code.
INTERNAL ERROR
An internal error is a diagnostic message that signals that there has been a serious and
unexpected failure due to a fault in the assembler. It is produced using the following
form:
Internal error: message
ACF-1:Final
Index
Index
value assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
A #pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
absolute expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 assembler environment variables . . . . . . . . . . . . . . . . . . . . . 4
absolute segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 assembler expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
__ACF__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . . 9 assembler instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
ACF_INC (environment variable) . . . . . . . . . . . . . . . . . . . . . 4 assembler invocation syntax . . . . . . . . . . . . . . . . . . . . . . . . . 3
ADD (CFI operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 assembler labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
address field, in assembler list file . . . . . . . . . . . . . . . . . . . 13 format of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
ALIGN (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . 59 assembler list files
alignment, of segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 address field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
ALIGNRAM (assembler directive) . . . . . . . . . . . . . . . . . . . 59 comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
AND (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . 38 conditional code and strings . . . . . . . . . . . . . . . . . . . . . . 78
AND (CFI operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 cross-references, generating . . . . . . . . . . . . . . . . . . . 25, 79
architecture, ColdFire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix data field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
ARGFRAME (assembler directive) . . . . . . . . . . . . . . . . . . 91 disabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
_args (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . 70 enabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
_args (predefined macro symbol) . . . . . . . . . . . . . . . . . . . . 72 filename, specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
ASCII character constants. . . . . . . . . . . . . . . . . . . . . . . . . . . 7 generated lines, controlling . . . . . . . . . . . . . . . . . . . . . . 79
ASEG (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 59 macro-generated lines, controlling . . . . . . . . . . . . . . . . . 78
ASEGN (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . 59 symbol and cross-reference table . . . . . . . . . . . . . . . . . . 13
asm (filename extension) . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 assembler macros
ASMCF (environment variable) . . . . . . . . . . . . . . . . . . . . . . 4 arguments, passing to . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
assembler BLOCK (assembler directive) . . . . . . . . . . . . . . 56 defining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
assembler control directives . . . . . . . . . . . . . . . . . . . . . . . . 88 generated lines, controlling in list file . . . . . . . . . . . . . . 78
assembler diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 in-line routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
assembler directives predefined symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
assembler control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
call frame information (CFI) . . . . . . . . . . . . . . . . . . . . . 92 quote characters, specifying . . . . . . . . . . . . . . . . . . . . . . 26
conditional assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 special characters, using. . . . . . . . . . . . . . . . . . . . . . . . . 72
See also C-style preprocessor directives assembler object file, specifying filename. . . . . . . . . . . . . . 28
C-style preprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 assembler operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
data definition or allocation . . . . . . . . . . . . . . . . . . . . . . 85 in expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
list file control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 assembler options
macro processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 passing to assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
module control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 specifying parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 16
segment control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 typographic convention . . . . . . . . . . . . . . . . . . . . . . . . . xi
symbol control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 assembler output, including debug information . . . . . . 19, 30
111
ACF-1:Final
assembler source files, including . . . . . . . . . . . . . . . . . . . . 83 ColdFire architecture and instruction set . . . . . . . . . . . . . . . ix
assembler source format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 command line options
assembler subversion number . . . . . . . . . . . . . . . . . . . . . . . 10 part of invocation syntax . . . . . . . . . . . . . . . . . . . . . . . . . 3
assembler symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 passing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
exporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 command line, extending . . . . . . . . . . . . . . . . . . . . . . . . . . 23
importing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 comments
in relocatable expressions . . . . . . . . . . . . . . . . . . . . . . . 11 in assembler list file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 in assembler source code . . . . . . . . . . . . . . . . . . . . . . . . . 5
predefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 multi-line, using with assembler directives . . . . . . . . . . 89
redefining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 comments, in C-style preprocessor directives . . . . . . . . . . . 84
assembling, syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 common segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
ASSIGN (assembler directive) . . . . . . . . . . . . . . . . . . . . . . 64 COMMON (assembler directive) . . . . . . . . . . . . . . . . . . . . 59
assumptions (programming experience) . . . . . . . . . . . . . . . ix COMPLEMENT (CFI operator) . . . . . . . . . . . . . . . . . . . . 101
computer style, typographic convention . . . . . . . . . . . . . . . xi
ACF-1:Final
Index
113
ACF-1:Final
false value, in assembler expressions . . . . . . . . . . . . . . . . . . 8 HWRD (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . 41
fatal error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
__FILE__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . . 9
file dependencies, tracking . . . . . . . . . . . . . . . . . . . . . . . . . 20 I
file extensions. See filename extensions -I (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
file types IAR Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
assembler source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 _ _IAR_SYSTEMS_ASM__ (predefined symbol) . . . . . . . 10
extended command line . . . . . . . . . . . . . . . . . . . . . . . . . 23 #if (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
#include, specifying path . . . . . . . . . . . . . . . . . . . . . . . . 24 IF (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
filename extensions IF (CFI operator). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
asm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 #ifdef (assembler directive). . . . . . . . . . . . . . . . . . . . . . . . . 81
msa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 #ifndef (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 81
s68 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 IMPORT (assembler directive) . . . . . . . . . . . . . . . . . . . . . . 56
xcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 #include files, specifying . . . . . . . . . . . . . . . . . . . . . . . . . . 24
filenames, specifying for assembler output . . . . . . . . . . . . . 28 #include (assembler directive) . . . . . . . . . . . . . . . . . . . . . . 81
filename, of object file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 include paths, specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
floating-point constants. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 instruction set
format, for assembler source code. . . . . . . . . . . . . . . . . . . . . 5 ColdFire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
__FPU__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . 10 identifying (__ISA__) . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--fpu (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 integer constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
fractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 internal error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
FRAME (CFI operator). . . . . . . . . . . . . . . . . . . . . . . . . . . 102 invocation syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
FUNCALL (assembler directive) . . . . . . . . . . . . . . . . . . . . 91 in-line coding, using macros . . . . . . . . . . . . . . . . . . . . . . . . 74
function directives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 __ISA__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . . 10
FUNCTION (assembler directive) . . . . . . . . . . . . . . . . . . . 91 --isa (assembler option). . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
G L
GE (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 -l (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
GE (CFI operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 labels. See assembler labels
global value, defining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 LE (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
GT (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 LE (CFI operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
GT (CFI operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 library modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
LIBRARY (assembler directive) . . . . . . . . . . . . . . . . . . 52–53
ACF-1:Final
Index
M
-M (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 O
__MAC__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . 10 -o (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
--mac (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . 26 ODD (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . 59
macro processing directives . . . . . . . . . . . . . . . . . . . . . . . . 70 --only_stdout (assembler option) . . . . . . . . . . . . . . . . . . . . 28
macro quote characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 operands
specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 format of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
MACRO (assembler directive) . . . . . . . . . . . . . . . . . . . . . . 70 in assembler expressions . . . . . . . . . . . . . . . . . . . . . . . . . 6
macros. See assembler macros operations, format of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
memory space, reserving and initializing . . . . . . . . . . . . . . 87 operation, silent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
memory, reserving space in . . . . . . . . . . . . . . . . . . . . . . . . . 85 operators. See assembler operators
message (#pragma directive) . . . . . . . . . . . . . . . . . . . . . . . 108 option summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
messages, excluding from standard output stream . . . . . . . 30 OR (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
--mnem_first (assembler option) . . . . . . . . . . . . . . . . . . . . . 27 OR (CFI operator). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
MOD (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . 43 ORG (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . 59
115
ACF-1:Final
OVERLAY (assembler directive) . . . . . . . . . . . . . . . . . . . . 56 remark (diagnostic message) . . . . . . . . . . . . . . . . . . . . . . . 109
classifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
P enabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
--remarks (assembler option) . . . . . . . . . . . . . . . . . . . . . . . 30
parameters repeating statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 REPT (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 70
typographic convention . . . . . . . . . . . . . . . . . . . . . . . . . xi REPTC (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . 70
PLC. See program location counter REPTI (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 70
#pragma (assembler directive) . . . . . . . . . . . . . . . . . . 81, 107 REQUIRE (assembler directive) . . . . . . . . . . . . . . . . . . . . . 56
precedence, of assembler operators . . . . . . . . . . . . . . . . . . . 33 RSEG (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 59
predefined register symbols . . . . . . . . . . . . . . . . . . . . . . . . . 9 RSHIFTA (CFI operator) . . . . . . . . . . . . . . . . . . . . . . . . . 102
predefined symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 RSHIFTL (CFI operator) . . . . . . . . . . . . . . . . . . . . . . . . . 102
in assembler macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 RTMODEL (assembler directive) . . . . . . . . . . . . . . . . . . . . 53
--preinclude (assembler option) . . . . . . . . . . . . . . . . . . . . . 29 rules, in CFI directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
--preprocess (assembler option) . . . . . . . . . . . . . . . . . . . . . 29 runtime model attributes, declaring . . . . . . . . . . . . . . . . . . . 55
preprocessor symbols
defining and undefining . . . . . . . . . . . . . . . . . . . . . . . . . 82
defining on command line . . . . . . . . . . . . . . . . . . . . . . . 19 S
prerequisites (programming experience) . . . . . . . . . . . . . . . ix segment control directives. . . . . . . . . . . . . . . . . . . . . . . . . . 59
program counter. See program location counter segments
program location counter (PLC) . . . . . . . . . . . . . . . . . . . . . . 8 absolute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 aligning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
program modules, beginning. . . . . . . . . . . . . . . . . . . . . . . . 54 common, beginning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
PROGRAM (assembler directive) . . . . . . . . . . . . . . . . . . . . 53 relocatable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
programming experience, required . . . . . . . . . . . . . . . . . . . ix SET (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . . 64
programming hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 severity level, of diagnostic messages . . . . . . . . . . . . . . . . 109
PUBLIC (assembler directive) . . . . . . . . . . . . . . . . . . . . . . 56 specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
PUBWEAK (assembler directive). . . . . . . . . . . . . . . . . . . . 56 SFB (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . 44
SFE (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . 44
SFR. See special function registers
R SHL (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . 45
-r (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 SHR (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . 45
RADIX (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . 89 --silent (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . 30
reference information, typographic convention . . . . . . . . . . xi silent operation, specifying . . . . . . . . . . . . . . . . . . . . . . . . . 30
registered trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii simple rules, in CFI directives. . . . . . . . . . . . . . . . . . . . . . . 99
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 SIZEOF (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . 45
relocatable expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 source files
relocatable segments, beginning . . . . . . . . . . . . . . . . . . . . . 61 including . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
list all referred . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
ACF-1:Final
Index
117
ACF-1:Final
#else (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . 81 --isa (assembler option). . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
#endif (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 81 --mac (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . 26
#error (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 81 --mnem_first (assembler option) . . . . . . . . . . . . . . . . . . . . . 27
#if (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 --no_div (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . 27
#ifdef (assembler directive). . . . . . . . . . . . . . . . . . . . . . . . . 81 --no_path_in_file_macros (assembler option) . . . . . . . . . . . 27
#ifndef (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 81 --no_supervisor (assembler option) . . . . . . . . . . . . . . . . . . . 27
#include files, specifying . . . . . . . . . . . . . . . . . . . . . . . . . . 24 --no_warnings (assembler option) . . . . . . . . . . . . . . . . . . . . 27
#include (assembler directive) . . . . . . . . . . . . . . . . . . . . . . 81 --no_wrap_diagnostics (assembler option) . . . . . . . . . . . . . 28
#line (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . 81 --only_stdout (assembler option) . . . . . . . . . . . . . . . . . . . . 28
#pragma (assembler directive) . . . . . . . . . . . . . . . . . . 81, 107 --preinclude (assembler option) . . . . . . . . . . . . . . . . . . . . . 29
#undef (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . 81 --preprocess (assembler option) . . . . . . . . . . . . . . . . . . . . . 29
$ (program location counter). . . . . . . . . . . . . . . . . . . . . . . . . 8 --remarks (assembler option) . . . . . . . . . . . . . . . . . . . . . . . 30
% (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 --silent (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . 30
& (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 --warnings_affect_exit_code (assembler option) . . . . . . . 4, 30
&& (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . 38 --warnings_are_errors (assembler option) . . . . . . . . . . . . . . 30
() (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 / (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
* (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 /*...*/ (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . 88
+ (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . 36–37 // (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
- (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 < (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
-D (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 << (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
-f (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 <= (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
-I (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 <> (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
-l (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 = (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
-M (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 = (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
-o (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 == (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
-r (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 > (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
--case_insensitive (assembler option) . . . . . . . . . . . . . . . . . 18 >= (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
--debug (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . 19 >> (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
--dependencies (assembler option) . . . . . . . . . . . . . . . . . . . 20 ?: (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
--diagnostics_tables (assembler option) . . . . . . . . . . . . . . . 22 ^ (assembler operator). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
--diag_error (assembler option). . . . . . . . . . . . . . . . . . . . . . 21 _args (assembler directive) . . . . . . . . . . . . . . . . . . . . . . . . . 70
--diag_remark (assembler option) . . . . . . . . . . . . . . . . . . . . 21 _args (predefined macro symbol) . . . . . . . . . . . . . . . . . . . . 72
--diag_suppress (assembler option) . . . . . . . . . . . . . . . . . . . 22 __ACF__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . . 9
--diag_warning (assembler option) . . . . . . . . . . . . . . . . . . . 22 __BUILD_NUMBER__ (predefined symbol) . . . . . . . . . . . 9
--dir_first (assembler option) . . . . . . . . . . . . . . . . . . . . . . . 23 __DATE__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . 9
--enable_multibytes (assembler option) . . . . . . . . . . . . . . . 23 __DIV__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . . 9
--error_limit (assembler option) . . . . . . . . . . . . . . . . . . . . . 23 __FILE__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . . 9
--fpu (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 __FPU__ (predefined symbol) . . . . . . . . . . . . . . . . . . . . . . 10
--header_context (assembler option) . . . . . . . . . . . . . . . . . . 24 __IAR_SYSTEMS_ASM__ (predefined symbol) . . . . . . . 10
ACF-1:Final
Index
119
ACF-1:Final