Predefined symbols
The IAR Assembler for RH850 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.
These predefined symbols are available:
Symbol | Value |
|---|---|
__IASMRH850__ | An integer that is set to |
| 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. |
| An integer that identifies the processor core in use. It is defined to |
| An integer that identifies the code model in use. The symbol reflects the |
| An integer that identifies the data model in use. The symbol reflects the |
| The current date in |
| The name of the current source file (string). |
| The symbol reflects the |
| IAR assembler identifier (number). The current value is 9. Note that the number could be higher in a future version of the product. This symbol can be tested with |
| The current source line number (number). |
| An integer that identifies the subversion number of the assembler version number, for example 3 in 1.2.3.4. |
| The current time in |
| The version number in integer format; for example, version 4.17 is returned as 417 (number). |
Including symbol values in code
Several data definition directives make it possible to include a symbol value in the code. These directives define values or reserve memory. To include a symbol value in the code, use the symbol in the appropriate data definition directive.
For example, to include the time of assembly as a string for the program to display:
name timeOfAssembly
section .text:CODE(2)
extern printStr
code
time: dc8 __TIME__ ; String representing the
; time of assembly.
align 1
mov time,r6 ; Load address of time
; string in r6.
jarl printStr,lp ; Call string output routine.
endTesting symbols for conditional assembly
To test a symbol at assembly time, use one of the conditional assembly directives. These directives let you control the assembly process at assembly time.
For example, if you want to assemble separate code sections depending on whether you are using an old assembler version or a new assembler version, do as follows:
#if (__VER__ > 300) ; New assembler version
;…
;…
#else ; Old assembler version
;…
;…
#endifFor more information, see Conditional assembly directives.