Commit | Line | Data |
---|---|---|
4b95cf5c | 1 | @c Copyright (C) 2011-2014 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 | |
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 | ||
856ea05c KP |
35 | @item m32bit-doubles |
36 | Mark the generated binary as one that uses 32-bits to hold the | |
37 | @code{double} floating point type. This is the default. | |
38 | ||
39 | @item m64bit-doubles | |
40 | Mark the generated binary as one that uses 64-bits to hold the | |
41 | @code{double} floating point type. | |
42 | ||
4046d87a | 43 | @end table |
99c513f6 DD |
44 | |
45 | @node RL78-Modifiers | |
46 | @section Symbolic Operand Modifiers | |
47 | ||
48 | @cindex RL78 modifiers | |
49 | @cindex syntax, RL78 | |
50 | ||
51 | The RL78 has three modifiers that adjust the relocations used by the | |
52 | linker: | |
53 | ||
54 | @table @code | |
55 | ||
56 | @item %lo16() | |
57 | ||
58 | When loading a 20-bit (or wider) address into registers, this modifier | |
59 | selects the 16 least significant bits. | |
60 | ||
61 | @smallexample | |
62 | movw ax,#%lo16(_sym) | |
63 | @end smallexample | |
64 | ||
65 | @item %hi16() | |
66 | ||
67 | When loading a 20-bit (or wider) address into registers, this modifier | |
68 | selects the 16 most significant bits. | |
69 | ||
70 | @smallexample | |
71 | movw ax,#%hi16(_sym) | |
72 | @end smallexample | |
73 | ||
74 | @item %hi8() | |
75 | ||
76 | When loading a 20-bit (or wider) address into registers, this modifier | |
77 | selects the 8 bits that would go into CS or ES (i.e. bits 23..16). | |
78 | ||
79 | @smallexample | |
80 | mov es, #%hi8(_sym) | |
81 | @end smallexample | |
82 | ||
83 | @end table | |
84 | ||
85 | @node RL78-Directives | |
86 | @section Assembler Directives | |
87 | ||
88 | @cindex assembler directives, RL78 | |
89 | @cindex RL78 assembler directives | |
90 | ||
91 | In addition to the common directives, the RL78 adds these: | |
92 | ||
93 | @table @code | |
94 | ||
95 | @item .double | |
856ea05c KP |
96 | Output a constant in ``double'' format, which is either a 32-bit |
97 | or a 64-bit floating point value, depending upon the setting of the | |
98 | @option{-m32bit-doubles}|@option{-m64bit-doubles} command line | |
99 | option. | |
99c513f6 DD |
100 | |
101 | @item .bss | |
102 | Select the BSS section. | |
103 | ||
104 | @item .3byte | |
105 | Output a constant value in a three byte format. | |
106 | ||
107 | @item .int | |
108 | @itemx .word | |
109 | Output a constant value in a four byte format. | |
110 | ||
111 | @end table | |
112 | ||
113 | @node RL78-Syntax | |
114 | @section Syntax for the RL78 | |
115 | @menu | |
116 | * RL78-Chars:: Special Characters | |
117 | @end menu | |
118 | ||
119 | @node RL78-Chars | |
120 | @subsection Special Characters | |
121 | ||
122 | @cindex line comment character, RL78 | |
123 | @cindex RL78 line comment character | |
124 | The presence of a @samp{;} appearing anywhere on a line indicates the | |
125 | start of a comment that extends to the end of that line. | |
126 | ||
127 | If a @samp{#} appears as the first character of a line then the whole | |
128 | line is treated as a comment, but in this case the line can also be a | |
129 | logical line number directive (@pxref{Comments}) or a preprocessor | |
130 | control command (@pxref{Preprocessing}). | |
131 | ||
132 | @cindex line separator, RL78 | |
133 | @cindex statement separator, RL78 | |
134 | @cindex RL78 line separator | |
135 | The @samp{|} character can be used to separate statements on the same | |
136 | line. |