2013-09-04 Muhammad Bilal <mbilal@codesourcery.com>
[deliverable/binutils-gdb.git] / gas / doc / c-rl78.texi
CommitLineData
4046d87a 1@c Copyright 2011-2013 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
16* RL78-Opts:: RL78 Assembler Command Line Options
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
31@item mg10
32Mark the generated binary as targeting the G10 variant of the RL78
33architecture.
34
35@end table
99c513f6
DD
36
37@node RL78-Modifiers
38@section Symbolic Operand Modifiers
39
40@cindex RL78 modifiers
41@cindex syntax, RL78
42
43The RL78 has three modifiers that adjust the relocations used by the
44linker:
45
46@table @code
47
48@item %lo16()
49
50When loading a 20-bit (or wider) address into registers, this modifier
51selects the 16 least significant bits.
52
53@smallexample
54 movw ax,#%lo16(_sym)
55@end smallexample
56
57@item %hi16()
58
59When loading a 20-bit (or wider) address into registers, this modifier
60selects the 16 most significant bits.
61
62@smallexample
63 movw ax,#%hi16(_sym)
64@end smallexample
65
66@item %hi8()
67
68When loading a 20-bit (or wider) address into registers, this modifier
69selects the 8 bits that would go into CS or ES (i.e. bits 23..16).
70
71@smallexample
72 mov es, #%hi8(_sym)
73@end smallexample
74
75@end table
76
77@node RL78-Directives
78@section Assembler Directives
79
80@cindex assembler directives, RL78
81@cindex RL78 assembler directives
82
83In addition to the common directives, the RL78 adds these:
84
85@table @code
86
87@item .double
88Output a constant in ``double'' format, which is a 32-bit floating
89point value on RL78.
90
91@item .bss
92Select the BSS section.
93
94@item .3byte
95Output a constant value in a three byte format.
96
97@item .int
98@itemx .word
99Output a constant value in a four byte format.
100
101@end table
102
103@node RL78-Syntax
104@section Syntax for the RL78
105@menu
106* RL78-Chars:: Special Characters
107@end menu
108
109@node RL78-Chars
110@subsection Special Characters
111
112@cindex line comment character, RL78
113@cindex RL78 line comment character
114The presence of a @samp{;} appearing anywhere on a line indicates the
115start of a comment that extends to the end of that line.
116
117If a @samp{#} appears as the first character of a line then the whole
118line is treated as a comment, but in this case the line can also be a
119logical line number directive (@pxref{Comments}) or a preprocessor
120control command (@pxref{Preprocessing}).
121
122@cindex line separator, RL78
123@cindex statement separator, RL78
124@cindex RL78 line separator
125The @samp{|} character can be used to separate statements on the same
126line.
This page took 0.091689 seconds and 4 git commands to generate.