1 @c Copyright (C) 2008-2019 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
8 @chapter LM32 Dependent Features
12 @node Machine Dependencies
13 @chapter LM32 Dependent Features
18 * LM32 Options:: Options
19 * LM32 Syntax:: Syntax
20 * LM32 Opcodes:: Opcodes
25 @cindex LM32 options (none)
26 @cindex options for LM32 (none)
30 @cindex @code{-mmultiply-enabled} command-line option, LM32
31 @item -mmultiply-enabled
32 Enable multiply instructions.
34 @cindex @code{-mdivide-enabled} command-line option, LM32
35 @item -mdivide-enabled
36 Enable divide instructions.
38 @cindex @code{-mbarrel-shift-enabled} command-line option, LM32
39 @item -mbarrel-shift-enabled
40 Enable barrel-shift instructions.
42 @cindex @code{-msign-extend-enabled} command-line option, LM32
43 @item -msign-extend-enabled
44 Enable sign extend instructions.
46 @cindex @code{-muser-enabled} command-line option, LM32
48 Enable user defined instructions.
50 @cindex @code{-micache-enabled} command-line option, LM32
51 @item -micache-enabled
52 Enable instruction cache related CSRs.
54 @cindex @code{-mdcache-enabled} command-line option, LM32
55 @item -mdcache-enabled
56 Enable data cache related CSRs.
58 @cindex @code{-mbreak-enabled} command-line option, LM32
60 Enable break instructions.
62 @cindex @code{-mall-enabled} command-line option, LM32
64 Enable all instructions and CSRs.
72 * LM32-Regs:: Register Names
73 * LM32-Modifiers:: Relocatable Expression Modifiers
74 * LM32-Chars:: Special Characters
78 @subsection Register Names
80 @cindex LM32 register names
81 @cindex register names, LM32
83 LM32 has 32 x 32-bit general purpose registers @samp{r0},
84 @samp{r1}, ... @samp{r31}.
86 The following aliases are defined: @samp{gp} - @samp{r26},
87 @samp{fp} - @samp{r27}, @samp{sp} - @samp{r28},
88 @samp{ra} - @samp{r29}, @samp{ea} - @samp{r30},
89 @samp{ba} - @samp{r31}.
91 LM32 has the following Control and Status Registers (CSRs).
101 Instruction cache control.
109 Exception base address.
113 Debug exception base address.
137 @subsection Relocatable Expression Modifiers
139 @cindex LM32 modifiers
142 The assembler supports several modifiers when using relocatable addresses
143 in LM32 instruction operands. The general syntax is the following:
146 modifier(relocatable-expression)
150 @cindex symbol modifiers
154 This modifier allows you to use bits 0 through 15 of
155 an address expression as 16 bit relocatable expression.
159 This modifier allows you to use bits 16 through 23 of an address expression
160 as 16 bit relocatable expression.
165 ori r4, r4, lo(sym+10)
166 orhi r4, r4, hi(sym+10)
171 This modified creates a 16-bit relocatable expression that is
172 the offset of the symbol from the global pointer.
180 This modifier places a symbol in the GOT and creates a 16-bit
181 relocatable expression that is the offset into the GOT of this
190 This modifier allows you to use the bits 0 through 15 of an
191 address which is an offset from the GOT.
195 This modifier allows you to use the bits 16 through 31 of an
196 address which is an offset from the GOT.
199 orhi r4, r4, gotoffhi16(lsym)
200 addi r4, r4, gotofflo16(lsym)
206 @subsection Special Characters
208 @cindex line comment character, LM32
209 @cindex LM32 line comment character
210 The presence of a @samp{#} on a line indicates the start of a comment
211 that extends to the end of the current line. Note that if a line
212 starts with a @samp{#} character then it can also be a logical line
213 number directive (@pxref{Comments}) or a preprocessor
214 control command (@pxref{Preprocessing}).
216 @cindex line separator, LM32
217 @cindex statement separator, LM32
218 @cindex LM32 line separator
219 A semicolon (@samp{;}) can be used to separate multiple statements on
225 @cindex LM32 opcode summary
226 @cindex opcode summary, LM32
227 @cindex mnemonics, LM32
228 @cindex instruction summary, LM32
229 For detailed information on the LM32 machine instruction set, see
230 @url{http://www.latticesemi.com/products/intellectualproperty/ipcores/mico32/}.
232 @code{@value{AS}} implements all the standard LM32 opcodes.