[.]
[external/binutils.git] / gas / doc / c-rl78.texi
1 @c Copyright 2011
2 @c Free Software Foundation, Inc.
3 @c This is part of the GAS manual.
4 @c For copying conditions, see the file as.texinfo.
5 @ifset GENERIC
6 @page
7 @node RL78-Dependent
8 @chapter RL78 Dependent Features
9 @end ifset
10 @ifclear GENERIC
11 @node Machine Dependencies
12 @chapter RL78 Dependent Features
13 @end ifclear
14
15 @cindex RL78 support
16 @menu
17 * RL78-Opts::                   RL78 Assembler Command Line Options
18 * RL78-Modifiers::              Symbolic Operand Modifiers
19 * RL78-Directives::             Assembler Directives
20 * RL78-Float::                  Floating Point
21 * RL78-Syntax::                 Syntax
22 @end menu
23
24 @node RL78-Opts
25 @section RL78 Options
26 @cindex options, RL78
27 @cindex RL78 options
28
29 The Renesas RL78 port of @code{@value{AS}} has no target-specific
30 options.
31
32 @node RL78-Modifiers
33 @section Symbolic Operand Modifiers
34
35 @cindex RL78 modifiers
36 @cindex syntax, RL78
37
38 The RL78 has three modifiers that adjust the relocations used by the
39 linker:
40
41 @table @code
42
43 @item %lo16()
44
45 When loading a 20-bit (or wider) address into registers, this modifier
46 selects the 16 least significant bits.
47
48 @smallexample
49   movw ax,#%lo16(_sym)
50 @end smallexample
51
52 @item %hi16()
53
54 When loading a 20-bit (or wider) address into registers, this modifier
55 selects the 16 most significant bits.
56
57 @smallexample
58   movw ax,#%hi16(_sym)
59 @end smallexample
60
61 @item %hi8()
62
63 When loading a 20-bit (or wider) address into registers, this modifier
64 selects the 8 bits that would go into CS or ES (i.e. bits 23..16).
65
66 @smallexample
67   mov es, #%hi8(_sym)
68 @end smallexample
69
70 @end table
71
72 @node RL78-Directives
73 @section Assembler Directives
74
75 @cindex assembler directives, RL78
76 @cindex RL78 assembler directives
77
78 In addition to the common directives, the RL78 adds these:
79
80 @table @code
81
82 @item .double
83 Output a constant in ``double'' format, which is a 32-bit floating
84 point value on RL78.
85
86 @item .bss
87 Select the BSS section.
88
89 @item .3byte
90 Output a constant value in a three byte format.
91
92 @item .int
93 @itemx .word
94 Output a constant value in a four byte format.
95
96 @end table
97
98 @node RL78-Syntax
99 @section Syntax for the RL78
100 @menu
101 * RL78-Chars::                Special Characters
102 @end menu
103
104 @node RL78-Chars
105 @subsection Special Characters
106
107 @cindex line comment character, RL78
108 @cindex RL78 line comment character
109 The presence of a @samp{;} appearing anywhere on a line indicates the
110 start of a comment that extends to the end of that line.
111
112 If a @samp{#} appears as the first character of a line then the whole
113 line is treated as a comment, but in this case the line can also be a
114 logical line number directive (@pxref{Comments}) or a preprocessor
115 control command (@pxref{Preprocessing}).
116
117 @cindex line separator, RL78
118 @cindex statement separator, RL78
119 @cindex RL78 line separator
120 The @samp{|} character can be used to separate statements on the same
121 line.