aboutsummaryrefslogtreecommitdiff
path: root/gas/doc/c-rl78.texi
blob: 0964ac456994cef127e7d1fa6768d35483de9a06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
@c Copyright 2011-2013 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@ifset GENERIC
@page
@node RL78-Dependent
@chapter RL78 Dependent Features
@end ifset
@ifclear GENERIC
@node Machine Dependencies
@chapter RL78 Dependent Features
@end ifclear

@cindex RL78 support
@menu
* RL78-Opts::                   RL78 Assembler Command Line Options
* RL78-Modifiers::              Symbolic Operand Modifiers
* RL78-Directives::             Assembler Directives
* RL78-Syntax::                 Syntax
@end menu

@node RL78-Opts
@section RL78 Options
@cindex options, RL78
@cindex RL78 options

@table @code
@item relax
Enable support for link-time relaxation.

@item mg10
Mark the generated binary as targeting the G10 variant of the RL78
architecture.

@end table

@node RL78-Modifiers
@section Symbolic Operand Modifiers

@cindex RL78 modifiers
@cindex syntax, RL78

The RL78 has three modifiers that adjust the relocations used by the
linker:

@table @code

@item %lo16()

When loading a 20-bit (or wider) address into registers, this modifier
selects the 16 least significant bits.

@smallexample
  movw ax,#%lo16(_sym)
@end smallexample

@item %hi16()

When loading a 20-bit (or wider) address into registers, this modifier
selects the 16 most significant bits.

@smallexample
  movw ax,#%hi16(_sym)
@end smallexample

@item %hi8()

When loading a 20-bit (or wider) address into registers, this modifier
selects the 8 bits that would go into CS or ES (i.e. bits 23..16).

@smallexample
  mov es, #%hi8(_sym)
@end smallexample

@end table

@node RL78-Directives
@section Assembler Directives

@cindex assembler directives, RL78
@cindex RL78 assembler directives

In addition to the common directives, the RL78 adds these:

@table @code

@item .double
Output a constant in ``double'' format, which is a 32-bit floating
point value on RL78.

@item .bss
Select the BSS section.

@item .3byte
Output a constant value in a three byte format.

@item .int
@itemx .word
Output a constant value in a four byte format.

@end table

@node RL78-Syntax
@section Syntax for the RL78
@menu
* RL78-Chars::                Special Characters
@end menu

@node RL78-Chars
@subsection Special Characters

@cindex line comment character, RL78
@cindex RL78 line comment character
The presence of a @samp{;} appearing anywhere on a line indicates the
start of a comment that extends to the end of that line.

If a @samp{#} appears as the first character of a line then the whole
line is treated as a comment, but in this case the line can also be a
logical line number directive (@pxref{Comments}) or a preprocessor
control command (@pxref{Preprocessing}).

@cindex line separator, RL78
@cindex statement separator, RL78
@cindex RL78 line separator
The @samp{|} character can be used to separate statements on the same
line.