Commodore 64 Miniature Basic programs - reversing or mirroring a byte

Published: 24 April 2022
on channel: Just for the Fun of It – Commodore Retro & BASIC
1,128
19

This time a few examples to reverse or flip a byte using Commodore Basic.

See full source examples on my blog. http://justforthefunofit.nl/uncategor...

You can type them in on a real Commodore 64 or use, for example, the vice emulator on a pc.

One of the examples created is the following code which uses a for Next loop.

10 b=int(rnd(1)*255) : r$="" :o$="00000000" :sb=.
20 for n=0to7:if b and 2^n then r = r+2^(7-n) : sb=1
60 r$=r$+mid$("01",1+sb,1):o$=left$(o$,7-n)+mid$("01",1+sb,1)+right$(o$,1+n)
70 sb=.:next:?"original byte value:" b,left$(o$,8):?"reversed byte value:"r,r$


On this page of the site you can watch the video online Commodore 64 Miniature Basic programs - reversing or mirroring a byte with a duration of hours minute second in good quality, which was uploaded by the user Just for the Fun of It – Commodore Retro & BASIC 24 April 2022, share the link with friends and acquaintances, this video has already been watched 1,128 times on youtube and it was liked by 19 viewers. Enjoy your viewing!