RL78 Dependent Features
***********************

RL78 Options
============

relax
     Enable support for link-time relaxation.

mg10
     Mark the generated binary as targeting the G10 variant of the RL78 architecture.

mg13
     Mark the generated binary as targeting the G13 variant of the RL78 architecture.

mg14
mrl78
     Mark the generated binary as targeting the G14 variant of the RL78 architecture.  This is the default.

m32bit-doubles
     Mark the generated binary as one that uses 32-bits to hold the double floating point type.  This is the default.

m64bit-doubles
     Mark the generated binary as one that uses 64-bits to hold the double floating point type.

Symbolic Operand Modifiers
==========================

The RL78 has three modifiers that adjust the relocations used by the linker:

%lo16()

     When loading a 20-bit (or wider) address into registers, this modifier selects the 16 least significant bits.

            movw ax,#%lo16(_sym)

%hi16()

     When loading a 20-bit (or wider) address into registers, this modifier selects the 16 most significant bits.

            movw ax,#%hi16(_sym)

%hi8()

     When loading a 20-bit (or wider) address into registers, this modifier selects the 8 bits that would go into CS or ES (i.e. bits 23..16).

            mov es, #%hi8(_sym)

Assembler Directives
====================

In addition to the common directives, the RL78 adds these:

.double
     Output a constant in ``double'' format, which is either a 32-bit or a 64-bit floating point value, depending upon the setting of the -m32bit-doubles|-m64bit-doubles command line option.

.bss
     Select the BSS section.

.3byte
     Output a constant value in a three byte format.

.int
.word
     Output a constant value in a four byte format.

Syntax for the RL78
===================

Special Characters
------------------

The presence of a ; appearing anywhere on a line indicates the start of a comment that extends to the end of that line.

If a # appears as the first character of a line then the whole line is treated as a comment, but in this case the line can also be a logical line number directive (see Comments) or a preprocessor control command (see Preprocessing).

The | character can be used to separate statements on the same line.