bit swap in byte


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 7456
Posted: 09:46pm 25 Jul 2022      

Here is a fun solution

sb%=(((ob% * &H80200802) AND &H0884422110) * &H0101010101 >> 32) and 255


> ob%=&B11011001
> sb% = (((ob% * &H80200802) AND &H0884422110) * &H0101010101 >> 32) and 255
> ? bin$(sb%)
10011011
>