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:
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.