Fix typo
[deliverable/binutils-gdb.git] / gas / doc / c-h8500.texi
CommitLineData
2da5c037
AM
1@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 2003
2@c Free Software Foundation, Inc.
252b5132
RH
3@c This is part of the GAS manual.
4@c For copying conditions, see the file as.texinfo.
5@page
6@node H8/500-Dependent
7@chapter H8/500 Dependent Features
8
9@cindex H8/500 support
10@menu
11* H8/500 Options:: Options
12* H8/500 Syntax:: Syntax
13* H8/500 Floating Point:: Floating Point
14* H8/500 Directives:: H8/500 Machine Directives
15* H8/500 Opcodes:: Opcodes
16@end menu
17
18@node H8/500 Options
19@section Options
20
21@cindex H8/500 options (none)
22@cindex options, H8/500 (none)
c2dcd04e
NC
23@code{@value{AS}} has no additional command-line options for the
24Renesas (formerly Hitachi) H8/500 family.
252b5132
RH
25
26@node H8/500 Syntax
27@section Syntax
28
29@menu
30* H8/500-Chars:: Special Characters
31* H8/500-Regs:: Register Names
32* H8/500-Addressing:: Addressing Modes
33@end menu
34
35@node H8/500-Chars
36@subsection Special Characters
37
38@cindex line comment character, H8/500
39@cindex H8/500 line comment character
40@samp{!} is the line comment character.
41
42@cindex line separator, H8/500
43@cindex statement separator, H8/500
44@cindex H8/500 line separator
45@samp{;} can be used instead of a newline to separate statements.
46
47@cindex symbol names, @samp{$} in
48@cindex @code{$} in symbol names
49Since @samp{$} has no special meaning, you may use it in symbol names.
50
51@node H8/500-Regs
52@subsection Register Names
53
54@cindex H8/500 registers
55@cindex registers, H8/500
56You can use the predefined symbols @samp{r0}, @samp{r1}, @samp{r2},
57@samp{r3}, @samp{r4}, @samp{r5}, @samp{r6}, and @samp{r7} to refer to
58the H8/500 registers.
59
60The H8/500 also has these control registers:
61
62@table @code
63@item cp
64code pointer
65
66@item dp
67data pointer
68
69@item bp
70base pointer
71
72@item tp
73stack top pointer
74
75@item ep
76extra pointer
77
78@item sr
79status register
80
81@item ccr
82condition code register
83@end table
84
85All registers are 16 bits long. To represent 32 bit numbers, use two
86adjacent registers; for distant memory addresses, use one of the segment
87pointers (@code{cp} for the program counter; @code{dp} for
88@code{r0}--@code{r3}; @code{ep} for @code{r4} and @code{r5}; and
89@code{tp} for @code{r6} and @code{r7}.
90
91@node H8/500-Addressing
92@subsection Addressing Modes
93
94@cindex addressing modes, H8/500
95@cindex H8/500 addressing modes
96@value{AS} understands the following addressing modes for the H8/500:
97@table @code
98@item R@var{n}
99Register direct
100
101@item @@R@var{n}
102Register indirect
103
104@item @@(d:8, R@var{n})
105Register indirect with 8 bit signed displacement
106
107@item @@(d:16, R@var{n})
108Register indirect with 16 bit signed displacement
109
110@item @@-R@var{n}
111Register indirect with pre-decrement
112
113@item @@R@var{n}+
114Register indirect with post-increment
115
116@item @@@var{aa}:8
1178 bit absolute address
118
119@item @@@var{aa}:16
12016 bit absolute address
121
122@item #@var{xx}:8
1238 bit immediate
124
125@item #@var{xx}:16
12616 bit immediate
127@end table
128
129@node H8/500 Floating Point
130@section Floating Point
131
132@cindex floating point, H8/500 (@sc{ieee})
133@cindex H8/500 floating point (@sc{ieee})
134The H8/500 family has no hardware floating point, but the @code{.float}
135directive generates @sc{ieee} floating-point numbers for compatibility
136with other development tools.
137
138@node H8/500 Directives
139@section H8/500 Machine Directives
140
141@cindex H8/500 machine directives (none)
142@cindex machine directives, H8/500 (none)
143@cindex @code{word} directive, H8/500
144@cindex @code{int} directive, H8/500
145@code{@value{AS}} has no machine-dependent directives for the H8/500.
146However, on this platform the @samp{.int} and @samp{.word} directives
147generate 16-bit numbers.
148
149@node H8/500 Opcodes
150@section Opcodes
151
152@cindex H8/500 opcode summary
153@cindex opcode summary, H8/500
154@cindex mnemonics, H8/500
155@cindex instruction summary, H8/500
156For detailed information on the H8/500 machine instruction set, see
c2dcd04e 157@cite{H8/500 Series Programming Manual} (Renesas M21T001).
252b5132
RH
158
159@code{@value{AS}} implements all the standard H8/500 opcodes. No additional
160pseudo-instructions are needed on this family.
161
162@ifset SMALL
163@c this table, due to the multi-col faking and hardcoded order, looks silly
164@c except in smallbook. See comments below "@set SMALL" near top of this file.
165
166The following table summarizes H8/500 opcodes and their operands:
167
168@c Use @group if it ever works, instead of @page
169@page
170@smallexample
171@i{Legend:}
172abs8 @r{8-bit absolute address}
173abs16 @r{16-bit absolute address}
174abs24 @r{24-bit absolute address}
175crb @r{@code{ccr}, @code{br}, @code{ep}, @code{dp}, @code{tp}, @code{dp}}
176disp8 @r{8-bit displacement}
177ea @r{@code{rn}, @code{@@rn}, @code{@@(d:8, rn)}, @code{@@(d:16, rn)},}
178 @r{@code{@@-rn}, @code{@@rn+}, @code{@@aa:8}, @code{@@aa:16},}
179 @r{@code{#xx:8}, @code{#xx:16}}
180ea_mem @r{@code{@@rn}, @code{@@(d:8, rn)}, @code{@@(d:16, rn)},}
181 @r{@code{@@-rn}, @code{@@rn+}, @code{@@aa:8}, @code{@@aa:16}}
182ea_noimm @r{@code{rn}, @code{@@rn}, @code{@@(d:8, rn)}, @code{@@(d:16, rn)},}
183 @r{@code{@@-rn}, @code{@@rn+}, @code{@@aa:8}, @code{@@aa:16}}
184fp r6
185imm4 @r{4-bit immediate data}
186imm8 @r{8-bit immediate data}
187imm16 @r{16-bit immediate data}
188pcrel8 @r{8-bit offset from program counter}
189pcrel16 @r{16-bit offset from program counter}
190qim @r{@code{-2}, @code{-1}, @code{1}, @code{2}}
191rd @r{any register}
192rs @r{a register distinct from rd}
193rlist @r{comma-separated list of registers in parentheses;}
194 @r{register ranges @code{rd-rs} are allowed}
195sp @r{stack pointer (@code{r7})}
196sr @r{status register}
197sz @r{size; @samp{.b} or @samp{.w}. If omitted, default @samp{.w}}
198
199ldc[.b] ea,crb bcc[.w] pcrel16
200ldc[.w] ea,sr bcc[.b] pcrel8
201add[:q] sz qim,ea_noimm bhs[.w] pcrel16
202add[:g] sz ea,rd bhs[.b] pcrel8
203adds sz ea,rd bcs[.w] pcrel16
204addx sz ea,rd bcs[.b] pcrel8
205and sz ea,rd blo[.w] pcrel16
206andc[.b] imm8,crb blo[.b] pcrel8
207andc[.w] imm16,sr bne[.w] pcrel16
208bpt bne[.b] pcrel8
209bra[.w] pcrel16 beq[.w] pcrel16
210bra[.b] pcrel8 beq[.b] pcrel8
211bt[.w] pcrel16 bvc[.w] pcrel16
212bt[.b] pcrel8 bvc[.b] pcrel8
213brn[.w] pcrel16 bvs[.w] pcrel16
214brn[.b] pcrel8 bvs[.b] pcrel8
215bf[.w] pcrel16 bpl[.w] pcrel16
216bf[.b] pcrel8 bpl[.b] pcrel8
217bhi[.w] pcrel16 bmi[.w] pcrel16
218bhi[.b] pcrel8 bmi[.b] pcrel8
219bls[.w] pcrel16 bge[.w] pcrel16
220bls[.b] pcrel8 bge[.b] pcrel8
221@page
222blt[.w] pcrel16 mov[:g][.b] imm8,ea_mem
223blt[.b] pcrel8 mov[:g][.w] imm16,ea_mem
224bgt[.w] pcrel16 movfpe[.b] ea,rd
225bgt[.b] pcrel8 movtpe[.b] rs,ea_noimm
226ble[.w] pcrel16 mulxu sz ea,rd
227ble[.b] pcrel8 neg sz ea
228bclr sz imm4,ea_noimm nop
229bclr sz rs,ea_noimm not sz ea
230bnot sz imm4,ea_noimm or sz ea,rd
231bnot sz rs,ea_noimm orc[.b] imm8,crb
232bset sz imm4,ea_noimm orc[.w] imm16,sr
233bset sz rs,ea_noimm pjmp abs24
234bsr[.b] pcrel8 pjmp @@rd
235bsr[.w] pcrel16 pjsr abs24
236btst sz imm4,ea_noimm pjsr @@rd
237btst sz rs,ea_noimm prtd imm8
238clr sz ea prtd imm16
239cmp[:e][.b] imm8,rd prts
240cmp[:i][.w] imm16,rd rotl sz ea
241cmp[:g].b imm8,ea_noimm rotr sz ea
242cmp[:g][.w] imm16,ea_noimm rotxl sz ea
243Cmp[:g] sz ea,rd rotxr sz ea
244dadd rs,rd rtd imm8
245divxu sz ea,rd rtd imm16
246dsub rs,rd rts
247exts[.b] rd scb/f rs,pcrel8
248extu[.b] rd scb/ne rs,pcrel8
249jmp @@rd scb/eq rs,pcrel8
250jmp @@(imm8,rd) shal sz ea
251jmp @@(imm16,rd) shar sz ea
252jmp abs16 shll sz ea
253jsr @@rd shlr sz ea
254jsr @@(imm8,rd) sleep
255jsr @@(imm16,rd) stc[.b] crb,ea_noimm
256jsr abs16 stc[.w] sr,ea_noimm
257ldm @@sp+,(rlist) stm (rlist),@@-sp
258link fp,imm8 sub sz ea,rd
259link fp,imm16 subs sz ea,rd
260mov[:e][.b] imm8,rd subx sz ea,rd
261mov[:i][.w] imm16,rd swap[.b] rd
262mov[:l][.w] abs8,rd tas[.b] ea
263mov[:l].b abs8,rd trapa imm4
264mov[:s][.w] rs,abs8 trap/vs
265mov[:s].b rs,abs8 tst sz ea
266mov[:f][.w] @@(disp8,fp),rd unlk fp
267mov[:f][.w] rs,@@(disp8,fp) xch[.w] rs,rd
268mov[:f].b @@(disp8,fp),rd xor sz ea,rd
269mov[:f].b rs,@@(disp8,fp) xorc.b imm8,crb
270mov[:g] sz rs,ea_mem xorc.w imm16,sr
271mov[:g] sz ea,rd
272@end smallexample
273@end ifset
This page took 0.403288 seconds and 4 git commands to generate.