333
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Data Shift Instruction
3
NASL/NSLL
Flags
Function
z NASL
NASL(580) shifts D (the shift word) by the specified number of binary bits (specified in C) to the left
(from the rightmost bit to the leftmost bit). Either zeros or the value of the rightmost bit will be placed
into the specified number of bits of the shift word starting from the rightmost bit.
z NSLL
NSLL(582) shifts D and D+1 (the shift words) by the specified number of binary bits (specified in C) to
the left (from the rightmost bit to the leftmost bit). Either zeros or the value of the rightmost bit will be
placed into the specified number of bits of the shift word starting from the rightmost bit.
Precautions
• For any bits which are shifted outside the specified word, the contents of the last bit is shifted to the
Carry Flag (CY), and all other data is lost.
• When the number of bits to shift (specified in C) is “0,” the data will not be shifted. The appropriate
flags will turn ON and OFF, however, according to data in the specified word.
Example Programming
When CIO 0.00 is ON, The contents of CIO 100 is shifted 10 bits to the left (from the rightmost bit to the
leftmost bit). The number of bits to shift is specified in bits 0 to 7 of word CIO 300 (control data). The
contents of bit 0 of CIO 100 is copied into bits from which data was shifted and the contents of the
rightmost bit which was shifted out of range is shifted into the Carry Flag (CY). All other data is lost.
Name Label Operation
Error Flag ER • ON when the control word C (the number of bits to shift) is not within range.
• OFF in all other cases.
Equals Flag = • ON when the shift result is 0.
• OFF in all other cases.
Carry Flag CY • ON when 1 is shifted into the Carry Flag (CY).
• OFF in all other cases.
Negative Flag N • ON when the leftmost bit is 1 as a result of the shift.
• OFF in all other cases.
Shift n-bits
Contents of "a" or "0" shifted in
N bits
Lost
Shift n-bits
Contents of "a"
or "0" shifted in
N bits
Lost