6F3B0253

7. Instructions

FUN 071

SHL

n bit shift left

Expression

Input [ A SHL n B ]Output

Function

When the input is ON, the data of register A is shifted n bits to the left (MSB direction) including the carry flag (CF = S050), and stored in B. 0 is stored in lower n bits. After the operation, if the left most bit (MSB) is ON, the output is turned ON.

Execution condition

Input

 

Operation

Output

CF

OFF

No execution

OFF

ON

Execution

When MSB = 1

ON

Set or reset

 

 

When MSB = 0

OFF

Set or reset

Operand

 

Name

 

 

Device

 

 

 

 

 

 

 

 

Register

 

 

 

 

Constant

Index

 

 

X

Y

R

S

T.

C.

XW

YW

RW

SW

T

C

D

I

J

K

 

 

A

Source

 

 

 

 

 

 

 

 

n

Shift bits

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 - 16

 

B

Destination

 

 

 

 

 

 

 

 

 

 

Example

When X008 is changed from OFF to ON, the data of RW18 is shifted 3 bits to the left and the result is stored in RW20.

The figure below shows an operation example.

CF 1

(MSB)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(LSB)

 

 

F E D C B A 9 8 7 6 5 4 3 2 1 0

 

 

1

 

0

1

0

0

1

1

1

0

0

1

1

1

0

1

 

0

 

RW18

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RW20 (Result)

 

0

 

0

1

1

1

0

0

1

1

1

0

1

0

0

0

 

0

 

R002 is turned OFF

0

Basic Hardware and Function 167

Page 169
Image 169
Toshiba 6F3B0253 user manual Shl