RSHIFT  i,n
Purpose To shift the integer variable i one bit to the right. i must be either an integer variable, a DM[] or a system variable such as relay[], output[], etc.

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

Examples RSHIFT 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 upper channel towards the lower channel. Bit #0 of Relay[4] will be shifted into Bit #15 of Relay[3] and so on. Bit #0 of the lowest channel Relay[2] will be lost

See Also LSHIFT

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