]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gas/doc/c-rl78.texi
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / gas / doc / c-rl78.texi
CommitLineData
250d07de 1@c Copyright (C) 2011-2021 Free Software Foundation, Inc.
99c513f6
DD
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
a05a5b64 16* RL78-Opts:: RL78 Assembler Command-line Options
99c513f6
DD
17* RL78-Modifiers:: Symbolic Operand Modifiers
18* RL78-Directives:: Assembler Directives
99c513f6
DD
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
4046d87a
NC
27@table @code
28@item relax
29Enable support for link-time relaxation.
30
e896287c
DD
31@item norelax
32Disable support for link-time relaxation (default).
33
4046d87a
NC
34@item mg10
35Mark the generated binary as targeting the G10 variant of the RL78
36architecture.
37
1740ba0c
NC
38@item mg13
39Mark the generated binary as targeting the G13 variant of the RL78
40architecture.
41
42@item mg14
43@itemx mrl78
44Mark the generated binary as targeting the G14 variant of the RL78
45architecture. This is the default.
46
856ea05c
KP
47@item m32bit-doubles
48Mark the generated binary as one that uses 32-bits to hold the
49@code{double} floating point type. This is the default.
50
51@item m64bit-doubles
52Mark the generated binary as one that uses 64-bits to hold the
53@code{double} floating point type.
54
4046d87a 55@end table
99c513f6
DD
56
57@node RL78-Modifiers
58@section Symbolic Operand Modifiers
59
60@cindex RL78 modifiers
61@cindex syntax, RL78
62
63The RL78 has three modifiers that adjust the relocations used by the
64linker:
65
66@table @code
67
68@item %lo16()
69
70When loading a 20-bit (or wider) address into registers, this modifier
71selects the 16 least significant bits.
72
73@smallexample
74 movw ax,#%lo16(_sym)
75@end smallexample
76
77@item %hi16()
78
79When loading a 20-bit (or wider) address into registers, this modifier
80selects the 16 most significant bits.
81
82@smallexample
83 movw ax,#%hi16(_sym)
84@end smallexample
85
86@item %hi8()
87
88When loading a 20-bit (or wider) address into registers, this modifier
89selects the 8 bits that would go into CS or ES (i.e. bits 23..16).
90
91@smallexample
92 mov es, #%hi8(_sym)
93@end smallexample
94
95@end table
96
97@node RL78-Directives
98@section Assembler Directives
99
100@cindex assembler directives, RL78
101@cindex RL78 assembler directives
102
103In addition to the common directives, the RL78 adds these:
104
105@table @code
106
107@item .double
856ea05c
KP
108Output a constant in ``double'' format, which is either a 32-bit
109or a 64-bit floating point value, depending upon the setting of the
a05a5b64 110@option{-m32bit-doubles}|@option{-m64bit-doubles} command-line
856ea05c 111option.
99c513f6
DD
112
113@item .bss
114Select the BSS section.
115
116@item .3byte
117Output a constant value in a three byte format.
118
119@item .int
120@itemx .word
121Output a constant value in a four byte format.
122
123@end table
124
125@node RL78-Syntax
126@section Syntax for the RL78
127@menu
128* RL78-Chars:: Special Characters
129@end menu
130
131@node RL78-Chars
132@subsection Special Characters
133
134@cindex line comment character, RL78
135@cindex RL78 line comment character
136The presence of a @samp{;} appearing anywhere on a line indicates the
137start of a comment that extends to the end of that line.
138
139If a @samp{#} appears as the first character of a line then the whole
140line is treated as a comment, but in this case the line can also be a
141logical line number directive (@pxref{Comments}) or a preprocessor
142control command (@pxref{Preprocessing}).
143
144@cindex line separator, RL78
145@cindex statement separator, RL78
146@cindex RL78 line separator
147The @samp{|} character can be used to separate statements on the same
148line.