Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
10 Applied Instructions (Rotation and Shift Operation)
10.3 RCR / Rotation Right with Carry
203
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 (RCR, RCRP)
"n" bits out of 16 bits of the device specified by and 1 bit (carry flag M8022) are rotated rightward.
The carry flag is intervened in the rotation loop. If M8022 has been set to ON or OFF before the rotation
instruction, the carry flag is transferred to the destination.
2. 32-bit operation (DRCR, DRCRP)
"n" bits out of 32 bits of the device specified by and 1 bit (carry flag M8022) are rotated rightward.
Rightward rotation data
RCR
EN
n
ENO
d
Command input
Number of bits
to be rotated
0
High order
Low order
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Before shift
b2 to b0
Before shift
b15 to b4
High order
Low order
Rightward rotation
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
When M8022 is ON
b2 (n-2) to b0 and the head bit
indicating the carry flag ON/OFF
status are moved.
"n" bits (in the case of K4)
b3 (n-1) to
b0 are
moved.
"n" bits
1
Carry flag
M8022
b3(n-1)
Before shift
Carry flagM8022
Before shift
b3
Carry flag
M8022
The status of the final
bit b3 (bit "n-1") is stored.
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0
After the
instruction
is executed
once.
Before
execution
After
execution
Command input
Number of bits
to be rotated
Rightward rotation data
DRCR
EN
n
ENO
d
Carry flagM8022
When M8022 is OFF
1
Carry flagM8022
Low order
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
High order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
Before shift b31 to b4
High order Low order
Rightward rotation
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
"n" bits (in the case of K4)
"n" bits
0
Before shift
Carry flagM8022
Before shift
b3
Before shift
b2 to b0
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 00 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
1 1 1 1 1 1 1 1 0 0 0 0 1 0 0 01 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
b2 (n-2) to b0 and the head bit
indicating the carry flag ON/OFF
status are moved.
The status
of the final
bit b3 (bit "n-1")
is stored.
After the instruction
is executed once.
Before
execution
After
execution