Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
10 Applied Instructions (Rotation and Shift Operation)
10.1 ROR / Rotation Right
197
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied Instructions
(Program Flow)
8
Applied Instructions
(Move and
Compare)
9
Applied Instructions
(Arithmetic and
Logical Operation)
10
Applied Instructions
(Rotation and
Shift Operation)
Function and operation explanation
1. 16-bit operation (ROR, RORP)
"n" bits out of 16 bits of the device specified by are rotated rightward.
The final bit is stored in the carry flag (M8022).
In a device with digit specification, K4 (16-bit instruction) is valid.
2. 32-bit operation (DROR, DRORP)
"n" bits out of 32 bits of the device specified by are rotated rightward.
The final bit is stored in the carry flag (M8022).
In a device with digit specification, K8 (32-bit instruction) is valid.
Command input
Number of bits
to be rotated
Rightward rotation data
ROR
EN
n
ENO
d
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0
Carry flag
M8022
High order Low order
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Before shift
b3 to b0
Before shift
b15 to b4
After the
instruction
is executed once.
High order
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Low order
M8022
"n" bits (in the case of K4)
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Before
execution
After
execution
Rightward rotation
"n-1" bits
The status of the bit "n-1" is copied.
Carry flag
"n-1" bits
b0 to b3 (n-1) are moved.
The contents of b3 are stored.
Rightward rotation data
DROR
EN
n
ENO
d
Command input
Number of bits
to be rotated
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0
Carry flag
M8022
Low order
Carry flag
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
High order
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Low order
M8022
Rightward rotation
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
"n" bits (in the case of K4)
"n-1" bits
The status of the bit
"n-1" is copied.
Before shift
b3 to b0
Before shift
b31 to b4
After the
instruction
is executed once.
High order
Before
execution
After
execution
b0 to b3 (n-1)
are moved.
The contents o
f
b3 are stored.
The status of the
bit "n-1" is copied.