Skip to main content

IAR Embedded Workbench for RL78 5.20

Programming hints

In this section:

Accessing special function registers

Specific header files for several RL78 devices are included in the IAR product package, in the rl78\inc directory. These header files define the processor-specific special function registers (SFRs) and the interrupt vector numbers.

The header files are intended to be used also with the IAR C/C++ Compiler for RL78, and they are suitable to use as templates when creating new header files for other RL78 derivatives.

If any assembler-specific additions are needed in the header file, you can easily add these in the assembler-specific part of the file:

#ifdef __IAR_SYSTEMS_ASM__
  ; Add your assembler-specific defines here.
#endif

Using C-style preprocessor directives

The C-style preprocessor directives are processed before other assembler directives. Therefore, do not use preprocessor directives in macros, and do not mix them with assembler-style comments. For more information about comments, .

C-style preprocessor directives like #define are valid in the remainder of the source code file, while assembler directives like EQU only are valid in the current module.