EasyManua.ls Logo

Freescale Semiconductor PowerPC e500 Core - Recommended Simplified Mnemonics; No-Op (Nop; Load Immediate (Li; Load Address (la

Default Icon
548 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
PowerPC e500 Core Family Reference Manual, Rev. 1
C-24 Freescale Semiconductor
Simplified Mnemonics for PowerPC Instructions
There is an additional simplified mnemonic formula for accessing SPRGs, although not all of
these more complicated simplified mnemonics are supported by all assemblers. These are shown
in Table C-28 along with the equivalent simplified mnemonic using the formula described above.
C.9 Recommended Simplified Mnemonics
This section describes commonly-used operations (such as no-op, load immediate, load address,
move register, and complement register).
C.9.1 No-Op (nop)
Many instructions can be coded in a way that, effectively, no operation is performed. An additional
mnemonic is provided for the preferred form of no-op. If an implementation performs any type of
run-time optimization related to no-ops, the preferred form is the following:
nop equivalent toori 0,0,0
C.9.2 Load Immediate (li)
The addi and addis instructions can be used to load an immediate value into a register. Additional
mnemonics are provided to convey the idea that no addition is being performed but that data is
being moved from the immediate operand of the instruction to a register.
1. Load a 16-bit signed immediate value into rD.
li rD,value equivalent to addi rD,0,value
2. Load a 16-bit signed immediate value, shifted left by 16 bits, into rD.
lis rD,value equivalent to addis rD,0,value
C.9.3 Load Address (la)
This mnemonic permits computing the value of a base-displacement operand, using the addi
instruction that normally requires a separate register and immediate operands.
la rD,d(rA) equivalent to addi rD,rA,d
The la mnemonic is useful for obtaining the address of a variable specified by name, allowing the
assembler to supply the base register number and compute the displacement. If the variable
v
is
Table C-28. Additional Simplified Mnemonics for Accessing SPRGs
SPR
Move to SPR Move from SPR
Simplified Mnemonic Equivalent to Simplified Mnemonic Equivalent to
SPRGs mtsprg
n,
rS mtspr 272 +
n
,rS mfsprg rD
, n
mfspr rD,272 +
n
mtsprg
n,
rS mfsprg
n
rD

Table of Contents

Related product manuals