1*a9fa9459Szrj@c Copyright (C) 2005-2016 Free Software Foundation, Inc.
2*a9fa9459Szrj@c This is part of the GAS manual.
3*a9fa9459Szrj@c For copying conditions, see the file as.texinfo.
4*a9fa9459Szrj@c man end
5*a9fa9459Szrj
6*a9fa9459Szrj@ifset GENERIC
7*a9fa9459Szrj@page
8*a9fa9459Szrj@node Blackfin-Dependent
9*a9fa9459Szrj@chapter Blackfin Dependent Features
10*a9fa9459Szrj@end ifset
11*a9fa9459Szrj
12*a9fa9459Szrj@ifclear GENERIC
13*a9fa9459Szrj@node Machine Dependencies
14*a9fa9459Szrj@chapter Blackfin Dependent Features
15*a9fa9459Szrj@end ifclear
16*a9fa9459Szrj
17*a9fa9459Szrj@cindex Blackfin support
18*a9fa9459Szrj@menu
19*a9fa9459Szrj* Blackfin Options::		Blackfin Options
20*a9fa9459Szrj* Blackfin Syntax::		Blackfin Syntax
21*a9fa9459Szrj* Blackfin Directives::		Blackfin Directives
22*a9fa9459Szrj@end menu
23*a9fa9459Szrj
24*a9fa9459Szrj@node Blackfin Options
25*a9fa9459Szrj@section Options
26*a9fa9459Szrj@cindex Blackfin options (none)
27*a9fa9459Szrj@cindex options for Blackfin (none)
28*a9fa9459Szrj
29*a9fa9459Szrj@c man begin OPTIONS
30*a9fa9459Szrj@table @gcctabopt
31*a9fa9459Szrj
32*a9fa9459Szrj@cindex @code{-mcpu=} command line option, Blackfin
33*a9fa9459Szrj@item -mcpu=@var{processor}@r{[}-@var{sirevision}@r{]}
34*a9fa9459SzrjThis option specifies the target processor.  The optional @var{sirevision}
35*a9fa9459Szrjis not used in assembler.  It's here such that GCC can easily pass down its
36*a9fa9459Szrj@code{-mcpu=} option.  The assembler will issue an
37*a9fa9459Szrjerror message if an attempt is made to assemble an instruction which
38*a9fa9459Szrjwill not execute on the target processor.  The following processor names are
39*a9fa9459Szrjrecognized:
40*a9fa9459Szrj@code{bf504},
41*a9fa9459Szrj@code{bf506},
42*a9fa9459Szrj@code{bf512},
43*a9fa9459Szrj@code{bf514},
44*a9fa9459Szrj@code{bf516},
45*a9fa9459Szrj@code{bf518},
46*a9fa9459Szrj@code{bf522},
47*a9fa9459Szrj@code{bf523},
48*a9fa9459Szrj@code{bf524},
49*a9fa9459Szrj@code{bf525},
50*a9fa9459Szrj@code{bf526},
51*a9fa9459Szrj@code{bf527},
52*a9fa9459Szrj@code{bf531},
53*a9fa9459Szrj@code{bf532},
54*a9fa9459Szrj@code{bf533},
55*a9fa9459Szrj@code{bf534},
56*a9fa9459Szrj@code{bf535} (not implemented yet),
57*a9fa9459Szrj@code{bf536},
58*a9fa9459Szrj@code{bf537},
59*a9fa9459Szrj@code{bf538},
60*a9fa9459Szrj@code{bf539},
61*a9fa9459Szrj@code{bf542},
62*a9fa9459Szrj@code{bf542m},
63*a9fa9459Szrj@code{bf544},
64*a9fa9459Szrj@code{bf544m},
65*a9fa9459Szrj@code{bf547},
66*a9fa9459Szrj@code{bf547m},
67*a9fa9459Szrj@code{bf548},
68*a9fa9459Szrj@code{bf548m},
69*a9fa9459Szrj@code{bf549},
70*a9fa9459Szrj@code{bf549m},
71*a9fa9459Szrj@code{bf561},
72*a9fa9459Szrjand
73*a9fa9459Szrj@code{bf592}.
74*a9fa9459Szrj
75*a9fa9459Szrj@cindex @code{-mfdpic} command line option, Blackfin
76*a9fa9459Szrj@item -mfdpic
77*a9fa9459SzrjAssemble for the FDPIC ABI.
78*a9fa9459Szrj
79*a9fa9459Szrj@cindex @code{-mno-fdpic} command line option, Blackfin
80*a9fa9459Szrj@cindex @code{-mnopic} command line option, Blackfin
81*a9fa9459Szrj@item -mno-fdpic
82*a9fa9459Szrj@itemx -mnopic
83*a9fa9459SzrjDisable -mfdpic.
84*a9fa9459Szrj@end table
85*a9fa9459Szrj@c man end
86*a9fa9459Szrj
87*a9fa9459Szrj@node Blackfin Syntax
88*a9fa9459Szrj@section Syntax
89*a9fa9459Szrj@cindex Blackfin syntax
90*a9fa9459Szrj@cindex syntax, Blackfin
91*a9fa9459Szrj
92*a9fa9459Szrj@table @code
93*a9fa9459Szrj@item Special Characters
94*a9fa9459SzrjAssembler input is free format and may appear anywhere on the line.
95*a9fa9459SzrjOne instruction may extend across multiple lines or more than one
96*a9fa9459Szrjinstruction may appear on the same line.  White space (space, tab,
97*a9fa9459Szrjcomments or newline) may appear anywhere between tokens.  A token must
98*a9fa9459Szrjnot have embedded spaces.  Tokens include numbers, register names,
99*a9fa9459Szrjkeywords, user identifiers, and also some multicharacter special
100*a9fa9459Szrjsymbols like "+=", "/*" or "||".
101*a9fa9459Szrj
102*a9fa9459SzrjComments are introduced by the @samp{#} character and extend to the
103*a9fa9459Szrjend of the current line.  If the @samp{#} appears as the first
104*a9fa9459Szrjcharacter of a line, the whole line is treated as a comment, but in
105*a9fa9459Szrjthis case the line can also be a logical line number directive
106*a9fa9459Szrj(@pxref{Comments}) or a preprocessor control command
107*a9fa9459Szrj(@pxref{Preprocessing}).
108*a9fa9459Szrj
109*a9fa9459Szrj@item Instruction Delimiting
110*a9fa9459SzrjA semicolon must terminate every instruction.  Sometimes a complete
111*a9fa9459Szrjinstruction will consist of more than one operation.  There are two
112*a9fa9459Szrjcases where this occurs.  The first is when two general operations
113*a9fa9459Szrjare combined.  Normally a comma separates the different parts, as in
114*a9fa9459Szrj
115*a9fa9459Szrj@smallexample
116*a9fa9459Szrja0= r3.h * r2.l, a1 = r3.l * r2.h ;
117*a9fa9459Szrj@end smallexample
118*a9fa9459Szrj
119*a9fa9459SzrjThe second case occurs when a general instruction is combined with one
120*a9fa9459Szrjor two memory references for joint issue.  The latter portions are
121*a9fa9459Szrjset off by a "||" token.
122*a9fa9459Szrj
123*a9fa9459Szrj@smallexample
124*a9fa9459Szrja0 = r3.h * r2.l || r1 = [p3++] || r4 = [i2++];
125*a9fa9459Szrj@end smallexample
126*a9fa9459Szrj
127*a9fa9459SzrjMultiple instructions can occur on the same line.  Each must be
128*a9fa9459Szrjterminated by a semicolon character.
129*a9fa9459Szrj
130*a9fa9459Szrj@item Register Names
131*a9fa9459Szrj
132*a9fa9459SzrjThe assembler treats register names and instruction keywords in a case
133*a9fa9459Szrjinsensitive manner.  User identifiers are case sensitive.  Thus, R3.l,
134*a9fa9459SzrjR3.L, r3.l and r3.L are all equivalent input to the assembler.
135*a9fa9459Szrj
136*a9fa9459SzrjRegister names are reserved and may not be used as program identifiers.
137*a9fa9459Szrj
138*a9fa9459SzrjSome operations (such as "Move Register") require a register pair.
139*a9fa9459SzrjRegister pairs are always data registers and are denoted using a colon,
140*a9fa9459Szrjeg., R3:2.  The larger number must be written firsts.  Note that the
141*a9fa9459Szrjhardware only supports odd-even pairs, eg., R7:6, R5:4, R3:2, and R1:0.
142*a9fa9459Szrj
143*a9fa9459SzrjSome instructions (such as --SP (Push Multiple)) require a group of
144*a9fa9459Szrjadjacent registers.  Adjacent registers are denoted in the syntax by
145*a9fa9459Szrjthe range enclosed in parentheses and separated by a colon, eg., (R7:3).
146*a9fa9459SzrjAgain, the larger number appears first.
147*a9fa9459Szrj
148*a9fa9459SzrjPortions of a particular register may be individually specified.  This
149*a9fa9459Szrjis written with a dot (".") following the register name and then a
150*a9fa9459Szrjletter denoting the desired portion.  For 32-bit registers, ".H"
151*a9fa9459Szrjdenotes the most significant ("High") portion.  ".L" denotes the
152*a9fa9459Szrjleast-significant portion.  The subdivisions of the 40-bit registers
153*a9fa9459Szrjare described later.
154*a9fa9459Szrj
155*a9fa9459Szrj@item Accumulators
156*a9fa9459SzrjThe set of 40-bit registers A1 and A0 that normally contain data that
157*a9fa9459Szrjis being manipulated.  Each accumulator can be accessed in four ways.
158*a9fa9459Szrj
159*a9fa9459Szrj@table @code
160*a9fa9459Szrj@item one 40-bit register
161*a9fa9459SzrjThe register will be referred to as A1 or A0.
162*a9fa9459Szrj@item one 32-bit register
163*a9fa9459SzrjThe registers are designated as A1.W or A0.W.
164*a9fa9459Szrj@item two 16-bit registers
165*a9fa9459SzrjThe registers are designated as A1.H, A1.L, A0.H or A0.L.
166*a9fa9459Szrj@item one 8-bit register
167*a9fa9459SzrjThe registers are designated as A1.X or A0.X for the bits that
168*a9fa9459Szrjextend beyond bit 31.
169*a9fa9459Szrj@end table
170*a9fa9459Szrj
171*a9fa9459Szrj@item Data Registers
172*a9fa9459SzrjThe set of 32-bit registers (R0, R1, R2, R3, R4, R5, R6 and R7) that
173*a9fa9459Szrjnormally contain data for manipulation.  These are abbreviated as
174*a9fa9459SzrjD-register or Dreg.  Data registers can be accessed as 32-bit registers
175*a9fa9459Szrjor as two independent 16-bit registers.  The least significant 16 bits
176*a9fa9459Szrjof each register is called the "low" half and is designated with ".L"
177*a9fa9459Szrjfollowing the register name.  The most significant 16 bits are called
178*a9fa9459Szrjthe "high" half and is designated with ".H" following the name.
179*a9fa9459Szrj
180*a9fa9459Szrj@smallexample
181*a9fa9459Szrj   R7.L, r2.h, r4.L, R0.H
182*a9fa9459Szrj@end smallexample
183*a9fa9459Szrj
184*a9fa9459Szrj@item Pointer Registers
185*a9fa9459SzrjThe set of 32-bit registers (P0, P1, P2, P3, P4, P5, SP and FP) that
186*a9fa9459Szrjnormally contain byte addresses of data structures.  These are
187*a9fa9459Szrjabbreviated as P-register or Preg.
188*a9fa9459Szrj
189*a9fa9459Szrj@smallexample
190*a9fa9459Szrjp2, p5, fp, sp
191*a9fa9459Szrj@end smallexample
192*a9fa9459Szrj
193*a9fa9459Szrj@item Stack Pointer SP
194*a9fa9459SzrjThe stack pointer contains the 32-bit address of the last occupied
195*a9fa9459Szrjbyte location in the stack.  The stack grows by decrementing the
196*a9fa9459Szrjstack pointer.
197*a9fa9459Szrj
198*a9fa9459Szrj@item Frame Pointer FP
199*a9fa9459SzrjThe frame pointer contains the 32-bit address of the previous frame
200*a9fa9459Szrjpointer in the stack.  It is located at the top of a frame.
201*a9fa9459Szrj
202*a9fa9459Szrj@item Loop Top
203*a9fa9459SzrjLT0 and LT1.  These registers contain the 32-bit address of the top of
204*a9fa9459Szrja zero overhead loop.
205*a9fa9459Szrj
206*a9fa9459Szrj@item Loop Count
207*a9fa9459SzrjLC0 and LC1.  These registers contain the 32-bit counter of the zero
208*a9fa9459Szrjoverhead loop executions.
209*a9fa9459Szrj
210*a9fa9459Szrj@item Loop Bottom
211*a9fa9459SzrjLB0 and LB1.  These registers contain the 32-bit address of the bottom
212*a9fa9459Szrjof a zero overhead loop.
213*a9fa9459Szrj
214*a9fa9459Szrj@item Index Registers
215*a9fa9459SzrjThe set of 32-bit registers (I0, I1, I2, I3) that normally contain byte
216*a9fa9459Szrjaddresses of data structures.  Abbreviated I-register or Ireg.
217*a9fa9459Szrj
218*a9fa9459Szrj@item Modify Registers
219*a9fa9459SzrjThe set of 32-bit registers (M0, M1, M2, M3) that normally contain
220*a9fa9459Szrjoffset values that are added and subtracted to one of the index
221*a9fa9459Szrjregisters.  Abbreviated as Mreg.
222*a9fa9459Szrj
223*a9fa9459Szrj@item Length Registers
224*a9fa9459SzrjThe set of 32-bit registers (L0, L1, L2, L3) that normally contain the
225*a9fa9459Szrjlength in bytes of the circular buffer.  Abbreviated as Lreg.  Clear
226*a9fa9459Szrjthe Lreg to disable circular addressing for the corresponding Ireg.
227*a9fa9459Szrj
228*a9fa9459Szrj@item Base Registers
229*a9fa9459SzrjThe set of 32-bit registers (B0, B1, B2, B3) that normally contain the
230*a9fa9459Szrjbase address in bytes of the circular buffer.  Abbreviated as Breg.
231*a9fa9459Szrj
232*a9fa9459Szrj@item Floating Point
233*a9fa9459SzrjThe Blackfin family has no hardware floating point but the .float
234*a9fa9459Szrjdirective generates ieee floating point numbers for use with software
235*a9fa9459Szrjfloating point libraries.
236*a9fa9459Szrj
237*a9fa9459Szrj@item Blackfin Opcodes
238*a9fa9459SzrjFor detailed information on the Blackfin machine instruction set, see
239*a9fa9459Szrjthe Blackfin(r) Processor Instruction Set Reference.
240*a9fa9459Szrj
241*a9fa9459Szrj@end table
242*a9fa9459Szrj
243*a9fa9459Szrj@node Blackfin Directives
244*a9fa9459Szrj@section Directives
245*a9fa9459Szrj@cindex Blackfin directives
246*a9fa9459Szrj@cindex directives, Blackfin
247*a9fa9459Szrj
248*a9fa9459SzrjThe following directives are provided for compatibility with the VDSP assembler.
249*a9fa9459Szrj
250*a9fa9459Szrj@table @code
251*a9fa9459Szrj@item .byte2
252*a9fa9459SzrjInitializes a two byte data object.
253*a9fa9459Szrj
254*a9fa9459SzrjThis maps to the @code{.short} directive.
255*a9fa9459Szrj@item .byte4
256*a9fa9459SzrjInitializes a four byte data object.
257*a9fa9459Szrj
258*a9fa9459SzrjThis maps to the @code{.int} directive.
259*a9fa9459Szrj@item .db
260*a9fa9459SzrjInitializes a single byte data object.
261*a9fa9459Szrj
262*a9fa9459SzrjThis directive is a synonym for @code{.byte}.
263*a9fa9459Szrj@item .dw
264*a9fa9459SzrjInitializes a two byte data object.
265*a9fa9459Szrj
266*a9fa9459SzrjThis directive is a synonym for @code{.byte2}.
267*a9fa9459Szrj@item .dd
268*a9fa9459SzrjInitializes a four byte data object.
269*a9fa9459Szrj
270*a9fa9459SzrjThis directive is a synonym for @code{.byte4}.
271*a9fa9459Szrj@item .var
272*a9fa9459SzrjDefine and initialize a 32 bit data object.
273*a9fa9459Szrj@end table
274