I was doing some VIC-20 programming earlier this week and someone suggested that I should add a custom character set to my program. As I'm lazy, I did a quick char set basically reducing the size of most characters by one pixel wide and high, but then I realised that I needed a reverse set of the same characters.
I could have used the char editor and done the reverse set but then I realised that this would require loading in twice the about of data and as I was likely to be doing a tape load (as this could be a Cronosoft release), this didn't seem like a good idea. So, here's a way to 'flip the bits' in CBM BASIC (in assembly, you'd simply XOR %11111111 or something like this).
Code: Select all
0 print "{clear}";
10 print "bit pattern 10101010 is 170 in decimal"
20 print "bit pattern 01010101 is 85 in decimal"
30 let x = 170
40 let y = not x and 255
50 print x; "flipped is"; y
60 print y; "flipped back again is"; not y and 255
Regards,
Shaun.