Motorola MPC823e Reference Manual page 1278

Microprocessor for mobile computing
Table of Contents

Advertisement

MPC823e Instruction Set—rlwnm
rlwnm
Assembler Syntax
BIT
0
1
2
FIELD
23
BIT
16
17
18
FIELD
B
Definition
Operation
Description
B-120
rlwnm
rA,rS,rB,MB,ME (Rc = 0)
rlwnm.
rA,rS,rB,MB,ME (Rc = 1)
3
4
5
6
7
19
20
21
22
23
MB
Rotate Left Word then AND with Mask
← rB[27-31]
n
r ← ROTL(rS,
)
n
m ← MASK(MB, ME)
rA ← r & m
The contents of rS are rotated left the number of bits specified
by the low-order five bits of rB. A mask is generated having 1 bits
from bit MB through bit ME and 0 bits elsewhere. The rotated
data is ANDed with the generated mask and the result is placed
into rA.
rlwnm can be used to extract and rotate bit fields using the
methods shown as follows:
To extract an n field, that starts at variable bit position b
in rS, right-justified into rA (clearing the remaining
32 – n bits of rA), by setting the low-order five bits of rB
to b + n, MB = 32 – n, and ME = 31.
To extract an n field, that starts at variable bit position b
in rS, left-justified into rA (clearing the remaining 32 – n
bits of rA), by setting the low-order five bits of rB to b,
MB = 0, and ME = n – 1.
To rotate the contents of a register left (or right) by n bits,
by setting the low-order five bits of rB to n (32 – n),
MB = 0, and ME = 31.
MPC823e REFERENCE MANUAL
8
9
10
11
12
S
24
25
26
27
28
ME
13
14
15
A
29
30
31
0
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents