Chapter 7 Second Development PlatformVP3000
325
API Instruction code Operand Function
31 D ROL P D, n
Rotate left
Type
Operand
Bit devices Word devices
16-bit instruction (5 steps)
ROL
Continuous
execution
type
ROLP
Pulse
execution
type
32-bit instruction (9 steps)
DROL
ontinuous
execution
type
DROLP
Pulse
execution
type
Associated flag: M1022, Carry flag
X Y M K H KnX KnY KnM T C D
D
n
Caution for using operand
If D is designated as KnY, KnM, only K4 (16-bit) is valid.
Scope of n = K1–K16 (16-bit)
Description
D: device to be rotated
n: number of bits to be rotated in 1 rotation
This instruction rotates the device content designated by D to the left for n bits.
This instruction adopts pulse execution instructions (ROLP).
Example
When X0 = OFFON, the 16 bits (4 bits as a group) in D10 rotates to the left, as shown in the
figure below. The bit marked with ※ is sent to carry flag M1022.