AV850-4IAR AssemblerReference Guidefor RenesasV850 Microcontroller FamilyAV850-4
AV850-410Other documentationIAR AssemblerReference Guide for V850summary of the assembler options, and contains detailed reference information about e
AV850-4100Call frame information directivesIAR AssemblerReference Guide for V850SYNTAXThe syntax definitions below show the syntax of each directive.
AV850-4Assembler directives101CFI STACKFRAME cfa resource type [, cfa resource type] …CFI STATICOVERLAYFRAME cfa segment [, cfa segment] …CFI BASEADDR
AV850-4102Call frame information directivesIAR AssemblerReference Guide for V850CFI resource { resource | FRAME(cfa, offset) }CFI resource cfiexprPARA
AV850-4Assembler directives103DESCRIPTIONSThe call frame information directives (CFI directives) are an extension to the debugging format of the IAR C
AV850-4104Call frame information directivesIAR AssemblerReference Guide for V850Inside a names block, four different kinds of declarations can appear:
AV850-4Assembler directives105such as routines for handling, entering, and leaving C or C++ functions; these routines manipulate the caller’s frame. E
AV850-4106Call frame information directivesIAR AssemblerReference Guide for V850Extend an existing common block with the directive:CFI COMMON name EXT
AV850-4Assembler directives107You can use these simple rules both in common blocks to describe the initial information for resources and CFAs, and ins
AV850-4108Call frame information directivesIAR AssemblerReference Guide for V850parts RETLO and RETHI. To declare that the value of RET can be found b
AV850-4Assembler directives109In the operand descriptions, cfiexpr denotes one of these:● A CFI operator with operands● A numeric constant● A CFA name
AV850-4Preface11TYPOGRAPHIC CONVENTIONSThis guide uses the following typographic conventions:NAMING CONVENTIONSThe following naming conventions are us
AV850-4110Call frame information directivesIAR AssemblerReference Guide for V850NE cfiexpr,cfiexpr Not equalOR cfiexpr,cfiexpr Bitwise ORRSHIFTA cf
AV850-4Assembler directives111Ternary operatorsOverall syntax: OPERATOR(operand1,operand2,operand3)EXAMPLEThe following is a generic example and not a
AV850-4112Call frame information directivesIAR AssemblerReference Guide for V850grows from high addresses toward zero. The CFA denotes the top of the
AV850-4Assembler directives113CFI RET FRAME(CFA,-2) ; Offset -2 from top of frameCFI ENDCOMMON trivialCommonNote: SP cannot be changed using a CFI di
AV850-4114Call frame information directivesIAR AssemblerReference Guide for V850
AV850-4115Assembler diagnosticsThis chapter describes the format of the diagnostic messages and explains how diagnostic messages are divided into diff
AV850-4116Severity levelsIAR AssemblerReference Guide for V850ASSEMBLY ERROR MESSAGESAssembly error messages are produced when the assembler finds a c
AV850-4Index117Aabsolute expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23absolute segments . . . . . . . . . . . . . . . . .
AV850-4118IAR AssemblerReference Guide for V850assembler optionspassing to assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . 15command l
AV850-4Index119constantsdefault base of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97integer . . . . . . . . . . . . . . . . . .
AV850-412Document conventionsIAR AssemblerReference Guide for V850IAR Assembler™ for V850 the assemblerIAR XLINK™ Linker XLINK, the linkerIAR XAR Libr
AV850-4120IAR AssemblerReference Guide for V850FF: (operand modifier) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71-f (assembler option
AV850-4Index121labels. See assembler labelsLE (CFI operator). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109less than or equal (assem
AV850-4122IAR AssemblerReference Guide for V850naming conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11NE (CFI operator). .
AV850-4Index123segment begin (assembler operator) . . . . . . . . . . . . . . . . . . 51segment control directives. . . . . . . . . . . . . . . . . .
AV850-4124IAR AssemblerReference Guide for V850W-w (assembler option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37warnings . . . . . .
AV850-4Index125% (assembler operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50+ (assembler operator) . . . . . . . . . . . . . . .
AV850-413Introduction to the IAR Assembler for V850This chapter contains these sections:● Introduction to assembler programming● Modular programming●
AV850-414Modular programmingIAR AssemblerReference Guide for V850● In the IAR Embedded Workbench IDE, you can base a new project on a template for an
AV850-4Introduction to the IAR Assembler for V85015● In each module, divide your assembler source code into small subroutines (corresponding to functi
AV850-416External interface detailsIAR AssemblerReference Guide for V850● Via environment variablesThe assembler automatically appends the value of th
AV850-4Introduction to the IAR Assembler for V85017Source formatThe format of an assembler source line is as follows:[label [:]] [operation] [operands
AV850-418Expressions, operands, and operatorsIAR AssemblerReference Guide for V850SYNTAX DEVIATIONSInstructions with a condition code as operandAssemb
AV850-4Introduction to the IAR Assembler for V85019Constants are written as a sequence of digits with an optional - (minus) sign in front to indicate
AV850-4COPYRIGHT NOTICECopyright © 1998–2010 IAR Systems AB.No part of this document may be reproduced without the prior written consent of IAR System
AV850-420Expressions, operands, and operatorsIAR AssemblerReference Guide for V850Floating-point numbers can be written in the format:[+|-][digits].[d
AV850-4Introduction to the IAR Assembler for V85021Note that symbols and labels are byte addresses. For additional information, see Generating a looku
AV850-422Expressions, operands, and operatorsIAR AssemblerReference Guide for V850in preprocessor directives or include them in the assembled code. Th
AV850-4Introduction to the IAR Assembler for V85023For example, to include the time of assembly as a string for the program to display:timdat db
AV850-424Expressions, operands, and operatorsIAR AssemblerReference Guide for V850 extern second extern third rseg
AV850-4Introduction to the IAR Assembler for V85025List file formatThe format of an assembler list file is as follows:HEADERThe header section contain
AV850-426Programming hintsIAR AssemblerReference Guide for V850Programming hintsThis section gives hints on how to write efficient code for the IAR As
AV850-427Assembler optionsThis chapter first explains how to set the options from the command line, and gives an alphabetical summary of the assembler
AV850-428Summary of assembler optionsIAR AssemblerReference Guide for V850By default, extended command line files have the extension xcl, and can be s
AV850-4Assembler options29Description of assembler optionsThe following sections give detailed reference information about each assembler option.Note
AV850-43ContentsTables ... 7Pref
AV850-430Description of assembler optionsIAR AssemblerReference Guide for V850This table shows the available parameters:To set related options, select
AV850-4Assembler options31-E -Enumber This option specifies the maximum number of errors that the assembler reports.By default, the maximum number is
AV850-432Description of assembler optionsIAR AssemblerReference Guide for V850When -G is used, you cannot specify a source filename.This option is not
AV850-4Assembler options33To simply generate a listing, use the -L option without a path. The listing is sent to the file with the same name as the so
AV850-434Description of assembler optionsIAR AssemblerReference Guide for V850in the source you would write, for example:print [>]to call a macro p
AV850-4Assembler options35ExampleTo send the object code to the file obj\prog.r85 rather than to the default file prog.r85:av850 prog -Oobj\ Project&g
AV850-436Description of assembler optionsIAR AssemblerReference Guide for V850By default, the assembler sends various insignificant messages via the s
AV850-4Assembler options37ExampleTo use the name of the predefined symbol __TIME__ for your own purposes, you could undefine it with:av850 prog -U__TI
AV850-438Description of assembler optionsIAR AssemblerReference Guide for V850Use this option to disable warnings. The -w option without a range disab
AV850-4Assembler options39These parameters are available:Project>Options>Assembler>List>Include cross referenceCommand line option Descrip
AV850-44IAR AssemblerReference Guide for V850Absolute and relocatable expressions ... 23Expression restr
AV850-440Description of assembler optionsIAR AssemblerReference Guide for V850
AV850-441Assembler operatorsThis chapter first describes the precedence of the assembler operators, and then summarizes the operators, classified acco
AV850-442Summary of assembler operatorsIAR AssemblerReference Guide for V850MULTIPLICATIVE ARITHMETIC OPERATORS – 2ADDITIVE ARITHMETIC OPERATORS – 3SH
AV850-4Assembler operators43OR OPERATORS – 6COMPARISON OPERATORS – 7Description of operatorsThe following sections give detailed descriptions of each
AV850-444Description of operatorsIAR AssemblerReference Guide for V850Example+3 → 33*+2 → 6+Addition (3).The + addition operator produces the sum of t
AV850-4Assembler operators45Example9/2 → 4-12/3 → -49/2*6 → 24AND (&&)Logical AND (5).Use && to perform logical AND between its two in
AV850-446Description of operatorsIAR AssemblerReference Guide for V850B’1010 | B’0000 → B’1010BINXOR (^)Bitwise exclusive OR (6).Use ^ to perform bitw
AV850-4Assembler operators47ExampleBYTE4 0x12345678 → 0x12DATECurrent time/date (1).Use the DATE operator to specify when the current assembly began.T
AV850-448Description of operatorsIAR AssemblerReference Guide for V8501 >= 1 → 1GT, >Greater than (7).> evaluates to 1 (true) if the left ope
AV850-4Assembler operators49To load a value from memory:MOVHI HI1(x), R0, R1LD.H LW1(x)[R1], R5HWRDHigh half word (1).HWRD takes a single operand, wh
AV850-4Contents5Symbol control directives ... 62Syntax ...
AV850-450Description of operatorsIAR AssemblerReference Guide for V850LW1Low half word with sign extension (1).LW1 takes a single operand, which is in
AV850-4Assembler operators51Example1 <> 2 → 12 <> 2 → 0'A' <> 'B' → 1NOT (!)Logical NOT (1).Use ! to negate a lo
AV850-452Description of operatorsIAR AssemblerReference Guide for V850Example name segmentBegin rseg MYCODE:CODE ; Forwar
AV850-4Assembler operators53SHL (<<)Logical shift left (4).Use << to shift the left operand, which is always treated as unsigned, to the l
AV850-454Description of operatorsIAR AssemblerReference Guide for V850Example module table rseg MYCODE:CODE ; Forward decla
AV850-455Assembler directivesThis chapter gives an alphabetical summary of the assembler directives and provides detailed reference information for ea
AV850-456Summary of assembler directivesIAR AssemblerReference Guide for V850#ifndef Assembles instructions if a symbol is undefined. C-style preproc
AV850-4Assembler directives57DEFINE Defines a file-wide value. Value assignmentDH Generates 16-bit half word constants. Data definition or allocationD
AV850-458Summary of assembler directivesIAR AssemblerReference Guide for V850LSTCND Controls conditional assembler listing. Listing controlLSTCOD Co
AV850-4Assembler directives59Module control directivesModule control directives are used for marking the beginning and end of source program modules,
AV850-46IAR AssemblerReference Guide for V850Descriptions ... 90Ex
AV850-460Module control directivesIAR AssemblerReference Guide for V850PARAMETERSDESCRIPTIONSBeginning a program moduleUse NAME or PROGRAM to begin a
AV850-4Assembler directives61Assembling multi-module filesProgram entries must be either relocatable or absolute, and will show up in XLINK load maps,
AV850-462Symbol control directivesIAR AssemblerReference Guide for V850 module mod_1 rtmodel "CAN", "ISO11519&q
AV850-4Assembler directives63PARAMETERSDESCRIPTIONSExporting symbols to other modulesUse PUBLIC to make one or more symbols available to other modules
AV850-464Symbol control directivesIAR AssemblerReference Guide for V850The REQUIRE directive marks a symbol as referenced. This is useful if the segme
AV850-4Assembler directives65Segment control directivesThe segment directives control how code and data are located. See Expression restrictions, page
AV850-466Segment control directivesIAR AssemblerReference Guide for V850STACK segment [:type] [(align)]PARAMETERSaddressAddress where this segment par
AV850-4Assembler directives67DESCRIPTIONSBeginning an absolute segmentUse ASEG to set the absolute mode of assembly, which is the default at the begin
AV850-468Segment control directivesIAR AssemblerReference Guide for V850must be absolute. However, when ORG is used in a relative segment (RSEG), the
AV850-4Assembler directives69 org 0hreset jr main org 2080hmain mov 1,R6 ; Start of cod
AV850-47Ta b l e s1: Typographic conventions used in this guide ... 112: Naming conventions u
AV850-470Value assignment directivesIAR AssemblerReference Guide for V850down ds 1 endBecause the common segments have the same
AV850-4Assembler directives71label SET exprlabel VAR exprPARAMETERSOPERAND MODIFIERSThese prefixes can be used for modifying operands:ExampleThe opera
AV850-472Value assignment directivesIAR AssemblerReference Guide for V850Defining a permanent local valueUse EQU or = to create a local symbol that de
AV850-4Assembler directives73 rseg CODE:CODEtable cr_tabl 4 endIt generates this code: 1 00000000
AV850-474Value assignment directivesIAR AssemblerReference Guide for V850Using local and global symbolsIn the following example the symbol value defin
AV850-4Assembler directives75changed at compile time, but values outside a defined range would cause undesirable behavior. module setLim
AV850-476Conditional assembly directivesIAR AssemblerReference Guide for V850DESCRIPTIONSUse the IF, ELSE, and ENDIF directives to control the assembl
AV850-4Assembler directives77Macro processing directivesThese directives allow user macros to be defined. See Expression restrictions, page 24, for a
AV850-478Macro processing directivesIAR AssemblerReference Guide for V850DESCRIPTIONSA macro is a user-defined symbol that represents a block of one o
AV850-4Assembler directives79The previous example could therefore be written as follows:errmac macro jarl abort,R7 db
AV850-48IAR AssemblerReference Guide for V85032: Binary operators in CFI expressions ...
AV850-480Macro processing directivesIAR AssemblerReference Guide for V850 dc8 \1 endif endm module fi
AV850-4Assembler directives81The macro expander has no knowledge of assembler symbols since it only deals with text substitutions at source level. Bef
AV850-482Macro processing directivesIAR AssemblerReference Guide for V850 add R9,R6 cmp R10,R6 bne loop
AV850-4Assembler directives83Using REPTC and REPTIThis example assembles a series of calls to a subroutine plot to plot each character in a string:
AV850-484Macro processing directivesIAR AssemblerReference Guide for V850 10 00000054 11 00000054 ENDThis example
AV850-4Assembler directives85Listing control directivesThese directives provide control over the assembler list file. SYNTAXCOL columnsLSTCND{+|-}LST
AV850-486Listing control directivesIAR AssemblerReference Guide for V850DESCRIPTIONSTurning the listing on or offUse LSTOUT- to disable all list outpu
AV850-4Assembler directives87Use PAGSIZ to set the number of printed lines per page of the assembler list. The default number of lines per page is 44.
AV850-488Listing control directivesIAR AssemblerReference Guide for V850 7 00000000 jarl print,R10 8 00000000
AV850-4Assembler directives89This produces the following output: 1 00000000 store MACRO reg,pos 2 00000000 S
AV850-49PrefaceWelcome to the IAR Assembler Reference Guide for V850. The purpose of this guide is to provide you with detailed reference information
AV850-490C-style preprocessor directivesIAR AssemblerReference Guide for V850#else#endif#error "message"#if condition#ifdef symbol#ifndef sy
AV850-4Assembler directives91Defining and undefining preprocessor symbolsUse #define to define a value of a preprocessor symbol.#define symbol valueUs
AV850-492C-style preprocessor directivesIAR AssemblerReference Guide for V850Ignoring #pragmaA #pragma line is ignored by the assembler, making it eas
AV850-4Assembler directives93EXAMPLESUsing conditional preprocessor directivesThis example defines a label adjust, and then uses the conditional direc
AV850-494Data definition or allocation directivesIAR AssemblerReference Guide for V850Data definition or allocation directivesThese directives define
AV850-4Assembler directives95Use DS, DS8, DS16, or DS32 to reserve a number of uninitialized bytes.EXAMPLESGenerating a lookup tableThis example gener
AV850-496Assembler control directivesIAR AssemblerReference Guide for V850Assembler control directivesThese directives provide control over the operat
AV850-4Assembler directives97Use RADIX to set the default base for constants. The default base is 10.Controlling case sensitivityUse CASEON or CASEOFF
AV850-498Function directivesIAR AssemblerReference Guide for V850Changing the baseTo set the default base to 16: radix 16D mov
AV850-4Assembler directives99DESCRIPTIONSFUNCTION declares the label name to be a function. value encodes extra information about the function.FUNCALL
Kommentare zu diesen Handbüchern