Retro Rocket OS
BASIC-Powered Operating System
Loading...
Searching...
No Matches
BITROL Function
X = BITROL(a, n, width)

Rotates integer a left by n bits within a given width.


How to read it

  • Only the lowest width bits participate in the rotation.
  • Width is typically 1โ€“64.
  • Result is masked back to the chosen width.

Examples

PRINT BITROL(&9, 1, 4)

This rotates 1001โ‚‚ left by one within 4 bits, giving 0011โ‚‚ = 3.


Notes

  • Operates on 64-bit integers.
  • Rotation width must be chosen carefully; too small discards high bits.

See also:
BITROR ยท BITSHL