Thanks to Abraxas contribution this code will be present in next thinBasic help release:
[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]
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks