1 @c Copyright 2008, 2011
2 @c Free Software Foundation, Inc.
3 @c This is part of the GAS manual.
4 @c For copying conditions, see the file as.texinfo.
9 @chapter LM32 Dependent Features
13 @node Machine Dependencies
14 @chapter LMĀ£" Dependent Features
19 * LM32 Options:: Options
20 * LM32 Syntax:: Syntax
21 * LM32 Opcodes:: Opcodes
26 @cindex LM32 options (none)
27 @cindex options for LM32 (none)
31 @cindex @code{-mmultiply-enabled} command line option, LM32
32 @item -mmultiply-enabled
33 Enable multiply instructions.
35 @cindex @code{-mdivide-enabled} command line option, LM32
36 @item -mdivide-enabled
37 Enable divide instructions.
39 @cindex @code{-mbarrel-shift-enabled} command line option, LM32
40 @item -mbarrel-shift-enabled
41 Enable barrel-shift instructions.
43 @cindex @code{-msign-extend-enabled} command line option, LM32
44 @item -msign-extend-enabled
45 Enable sign extend instructions.
47 @cindex @code{-muser-enabled} command line option, LM32
49 Enable user defined instructions.
51 @cindex @code{-micache-enabled} command line option, LM32
52 @item -micache-enabled
53 Enable instruction cache related CSRs.
55 @cindex @code{-mdcache-enabled} command line option, LM32
56 @item -mdcache-enabled
57 Enable data cache related CSRs.
59 @cindex @code{-mbreak-enabled} command line option, LM32
61 Enable break instructions.
63 @cindex @code{-mall-enabled} command line option, LM32
65 Enable all instructions and CSRs.
73 * LM32-Regs:: Register Names
74 * LM32-Modifiers:: Relocatable Expression Modifiers
75 * LM32-Chars:: Special Characters
79 @subsection Register Names
81 @cindex LM32 register names
82 @cindex register names, LM32
84 LM32 has 32 x 32-bit general purpose registers @samp{r0},
85 @samp{r1}, ... @samp{r31}.
87 The following aliases are defined: @samp{gp} - @samp{r26},
88 @samp{fp} - @samp{r27}, @samp{sp} - @samp{r28},
89 @samp{ra} - @samp{r29}, @samp{ea} - @samp{r30},
90 @samp{ba} - @samp{r31}.
92 LM32 has the following Control and Status Registers (CSRs).
102 Instruction cache control.
110 Exception base address.
114 Debug exception base address.
138 @subsection Relocatable Expression Modifiers
140 @cindex LM32 modifiers
143 The assembler supports several modifiers when using relocatable addresses
144 in LM32 instruction operands. The general syntax is the following:
147 modifier(relocatable-expression)
151 @cindex symbol modifiers
155 This modifier allows you to use bits 0 through 15 of
156 an address expression as 16 bit relocatable expression.
160 This modifier allows you to use bits 16 through 23 of an address expression
161 as 16 bit relocatable expression.
166 ori r4, r4, lo(sym+10)
167 orhi r4, r4, hi(sym+10)
172 This modified creates a 16-bit relocatable expression that is
173 the offset of the symbol from the global pointer.
181 This modifier places a symbol in the GOT and creates a 16-bit
182 relocatable expression that is the offset into the GOT of this
191 This modifier allows you to use the bits 0 through 15 of an
192 address which is an offset from the GOT.
196 This modifier allows you to use the bits 16 through 31 of an
197 address which is an offset from the GOT.
200 orhi r4, r4, gotoffhi16(lsym)
201 addi r4, r4, gotofflo16(lsym)
207 @subsection Special Characters
209 @cindex line comment character, LM32
210 @cindex LM32 line comment character
211 The presence of a @samp{#} on a line indicates the start of a comment
212 that extends to the end of the current line. Note that if a line
213 starts with a @samp{#} character then it can also be a logical line
214 number directive (@pxref{Comments}) or a preprocessor
215 control command (@pxref{Preprocessing}).
217 @cindex line separator, LM32
218 @cindex statement separator, LM32
219 @cindex LM32 line separator
220 A semicolon (@samp{;}) can be used to separate multiple statements on
226 @cindex LM32 opcode summary
227 @cindex opcode summary, LM32
228 @cindex mnemonics, LM32
229 @cindex instruction summary, LM32
230 For detailed information on the LM32 machine instruction set, see
231 @url{http://www.latticesemi.com/products/intellectualproperty/ipcores/mico32/}.
233 @code{@value{AS}} implements all the standard LM32 opcodes.