Add support for G13 and G14 flag bits in RL78 ELF binaries.
[deliverable/binutils-gdb.git] / gas / doc / c-rl78.texi
1 @c Copyright (C) 2011-2015 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
4 @ifset GENERIC
5 @page
6 @node RL78-Dependent
7 @chapter RL78 Dependent Features
8 @end ifset
9 @ifclear GENERIC
10 @node Machine Dependencies
11 @chapter RL78 Dependent Features
12 @end ifclear
13
14 @cindex RL78 support
15 @menu
16 * RL78-Opts:: RL78 Assembler Command Line Options
17 * RL78-Modifiers:: Symbolic Operand Modifiers
18 * RL78-Directives:: Assembler Directives
19 * RL78-Syntax:: Syntax
20 @end menu
21
22 @node RL78-Opts
23 @section RL78 Options
24 @cindex options, RL78
25 @cindex RL78 options
26
27 @table @code
28 @item relax
29 Enable support for link-time relaxation.
30
31 @item mg10
32 Mark the generated binary as targeting the G10 variant of the RL78
33 architecture.
34
35 @item mg13
36 Mark the generated binary as targeting the G13 variant of the RL78
37 architecture.
38
39 @item mg14
40 @itemx mrl78
41 Mark the generated binary as targeting the G14 variant of the RL78
42 architecture. This is the default.
43
44 @item m32bit-doubles
45 Mark the generated binary as one that uses 32-bits to hold the
46 @code{double} floating point type. This is the default.
47
48 @item m64bit-doubles
49 Mark the generated binary as one that uses 64-bits to hold the
50 @code{double} floating point type.
51
52 @end table
53
54 @node RL78-Modifiers
55 @section Symbolic Operand Modifiers
56
57 @cindex RL78 modifiers
58 @cindex syntax, RL78
59
60 The RL78 has three modifiers that adjust the relocations used by the
61 linker:
62
63 @table @code
64
65 @item %lo16()
66
67 When loading a 20-bit (or wider) address into registers, this modifier
68 selects the 16 least significant bits.
69
70 @smallexample
71 movw ax,#%lo16(_sym)
72 @end smallexample
73
74 @item %hi16()
75
76 When loading a 20-bit (or wider) address into registers, this modifier
77 selects the 16 most significant bits.
78
79 @smallexample
80 movw ax,#%hi16(_sym)
81 @end smallexample
82
83 @item %hi8()
84
85 When loading a 20-bit (or wider) address into registers, this modifier
86 selects the 8 bits that would go into CS or ES (i.e. bits 23..16).
87
88 @smallexample
89 mov es, #%hi8(_sym)
90 @end smallexample
91
92 @end table
93
94 @node RL78-Directives
95 @section Assembler Directives
96
97 @cindex assembler directives, RL78
98 @cindex RL78 assembler directives
99
100 In addition to the common directives, the RL78 adds these:
101
102 @table @code
103
104 @item .double
105 Output a constant in ``double'' format, which is either a 32-bit
106 or a 64-bit floating point value, depending upon the setting of the
107 @option{-m32bit-doubles}|@option{-m64bit-doubles} command line
108 option.
109
110 @item .bss
111 Select the BSS section.
112
113 @item .3byte
114 Output a constant value in a three byte format.
115
116 @item .int
117 @itemx .word
118 Output a constant value in a four byte format.
119
120 @end table
121
122 @node RL78-Syntax
123 @section Syntax for the RL78
124 @menu
125 * RL78-Chars:: Special Characters
126 @end menu
127
128 @node RL78-Chars
129 @subsection Special Characters
130
131 @cindex line comment character, RL78
132 @cindex RL78 line comment character
133 The presence of a @samp{;} appearing anywhere on a line indicates the
134 start of a comment that extends to the end of that line.
135
136 If a @samp{#} appears as the first character of a line then the whole
137 line is treated as a comment, but in this case the line can also be a
138 logical line number directive (@pxref{Comments}) or a preprocessor
139 control command (@pxref{Preprocessing}).
140
141 @cindex line separator, RL78
142 @cindex statement separator, RL78
143 @cindex RL78 line separator
144 The @samp{|} character can be used to separate statements on the same
145 line.
This page took 0.032941 seconds and 4 git commands to generate.