Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
27 Applied Instructions (Data Operation 3)
27.4 SFR / Bit Shift Right with Carry
665
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
3) "0" is set to "n" bits from the most significant bit.
When a bit device is specified by digit specification
(4 × K
) bits are shifted according to the data bit specification.)
Related device
For the carry flag use method, refer to Section 1.3.4.
Error
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is
stored in D8067.
1) When a negative value is set to "n" (Error code: 6706)
Program examples
In the program example shown below, the contents of Y010 to Y023 are shifted rightward by the number of
bits specified by D0 when X020 turns ON.
Device Name Description
M8022 Carry flag Shifts the ON/OFF status of bit "n-1"
1
b15
1
b14
1
b13
0
b12
1
b11
1
b10
1
b9
0
b8
1
b7
1
b6
1
b5
0
b4
1
b3
1
b2
1
b1
0
b0
0
b15
0
b14
0
b13
0
b12
0
b11
0
b10
1
b9
1
b8
1
b7
0
b6
1
b5
1
b4
1
b3
0
b2
1
b1
1
b0
In the case of "n = 6"
1
Carry flag
M8022
Becomes "0".
d
d
K3M0
LDP
EN
s
ENO
Command
input
SFRP
EN
n
ENO
K4
d
1
M11
0 1 0
M8
1 0 1 0 1 0 1 0
1
Carry flag
M8022
M7 M4 M3 M0
0 0 0 0 1 0 1 0 1 0 1 0
Becomes "0".
M11 M8M7 M4M3 M0
X020
SFRP
EN
n
ENO
d
K3Y010D0
[Structured ladder/FBD] [ST]
SFRP(X020,D0,K3Y010);
1 0 1 0 1 0 1 0 1 0 1 0
1
Carry flag
M8022
0 0 0 0 1 0 1 0 1 0 1 0
Becomes "0".
4
D0
Y23 Y20 Y17 Y14 Y13 Y10
Y23 Y20 Y17 Y14 Y13 Y10