[code=thinbasic]' Usage of the SHIFT Instruction example
' Binary Divide by 2 (no remainder)
Dim MyByte As Byte VALUE &h08 ' Initialise Byte to 8
Dim sMsg As String
sMsg += "Original Byte Value " & Hex$(MyByte,2) & $CRLF & $CRLF
SHIFT SIGNED RIGHT MyByte,1 ' Binary Divide by 2 probably quicker than a /
sMsg += " New Byte Value " & Hex$(MyByte,2) & $CRLF
MSGBOX 0, sMsg[/code]
Its all in the help file.
Bookmarks