]>
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 | ||
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 | ||
43 | The RL78 has three modifiers that adjust the relocations used by the | |
44 | linker: | |
45 | ||
46 | @table @code | |
47 | ||
48 | @item %lo16() | |
49 | ||
50 | When loading a 20-bit (or wider) address into registers, this modifier | |
51 | selects the 16 least significant bits. | |
52 | ||
53 | @smallexample | |
54 | movw ax,#%lo16(_sym) | |
55 | @end smallexample | |
56 | ||
57 | @item %hi16() | |
58 | ||
59 | When loading a 20-bit (or wider) address into registers, this modifier | |
60 | selects the 16 most significant bits. | |
61 | ||
62 | @smallexample | |
63 | movw ax,#%hi16(_sym) | |
64 | @end smallexample | |
65 | ||
66 | @item %hi8() | |
67 | ||
68 | When loading a 20-bit (or wider) address into registers, this modifier | |
69 | selects 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 | ||
83 | In addition to the common directives, the RL78 adds these: | |
84 | ||
85 | @table @code | |
86 | ||
87 | @item .double | |
88 | Output a constant in ``double'' format, which is a 32-bit floating | |
89 | point value on RL78. | |
90 | ||
91 | @item .bss | |
92 | Select the BSS section. | |
93 | ||
94 | @item .3byte | |
95 | Output a constant value in a three byte format. | |
96 | ||
97 | @item .int | |
98 | @itemx .word | |
99 | Output 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 | |
114 | The presence of a @samp{;} appearing anywhere on a line indicates the | |
115 | start of a comment that extends to the end of that line. | |
116 | ||
117 | If a @samp{#} appears as the first character of a line then the whole | |
118 | line is treated as a comment, but in this case the line can also be a | |
119 | logical line number directive (@pxref{Comments}) or a preprocessor | |
120 | control command (@pxref{Preprocessing}). | |
121 | ||
122 | @cindex line separator, RL78 | |
123 | @cindex statement separator, RL78 | |
124 | @cindex RL78 line separator | |
125 | The @samp{|} character can be used to separate statements on the same | |
126 | line. |