Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
10 Applied Instructions (Rotation and Shift Operation)
10.2 ROL / Rotation Left
200
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation (ROL, ROLP)
"n" bits out of 16 bits of the device specified by are rotated leftward.
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 (DROL, DROLP)
"n" bits out of 32 bits of the device specified by are rotated leftward.
The final bit is stored in the carry flag (M8022).
In a device with digit specification, K8 (32-bit instruction) is valid.
Leftward rotation data
ROL
EN
n
ENO
d
Command input
Number of bits
to be rotated
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
Leftward rotation
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Before shift
b15 to b12
Before shift
b11 to b0
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1
Carry flag
M8022
Carry flag
M8022
The contents of b12 are stored.
"n" bits (in the case of K4)
b12 (16-n) to b15 are moved.
"n" bits
The status of
the bit "16-n" is copied.
After the
instruction
is executed
once.
High order Low order
Before
execution
After
execution
High order Low order
Leftward rotation data
DROL
EN
n
ENO
d
Command input
Number of bits
to be rotated
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
Leftward rotation
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1
M8022
M8022
The contents of b28 are stored.
b28 (32-n) to b31 are moved.
The status of
the bit "32-n"
is copied
"16-n" bits
Before shift
b31 to b28
Before shift
b27 to b0
Carry flag
"n" bits (in the case of K4)
"n" bits
After the
instruction
is executed
once.
High order Low order
Before
execution
After
execution
Carry flag
High order Low order