HTBasic Help
×
Menu
Index

shift Example

10    INTEGER Y
20    Y=1000
30    CLEAR SCREEN
40    Msg("Original bits")
50    See(Y)
60    Y=SHIFT(Y,5)  !Shift the bits of Y over by 5 bits.
70    PRINT
80    Msg("Shift the bits over by 5")
90    See(Y)
100   END
110   SUB See(INTEGER X)
120     FOR Loop=15 TO 0 STEP -1
130       Temp=BIT(X,Loop)
140       PRINT Temp;
150     NEXT Loop
160   SUBEND
170   SUB Msg(Str$)
180     PRINT Str$
190   SUBEND