LSHIFT i, n
Purpose To shift 1 bit to the left the integer variable i which must be either an integer variable, a DM[n] or a system variable such as relay[n], output[n], etc.

LSHIFT instruction permits more than one variable to be chained together before performing a bit shift. The parameter n indicates the number of channels to be chained starting from i upward. n =1 if only one variable is involved.

Examples LSHIFT relay[2],3
Comments: The relay channels #2,#3, and #4 (which represent relays number #17 to #64) are chained together in the following manner:

Bits are shifted from the lower channel towards the upper channel. Bit #15 of Relay[2] will be shifted into Bit #0 of Relay[3] and so on. Bit #15 of the highest channel Relay[4] will be lost.

 

See Also RSHIFT

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual