Have you looked at the shift functions >> and << around page 32 in the PBP manual?
row 1 = %0001
row 2 = %0010
row 3 = %0100
row 4 = %1000
If you want a byte or word to do the above thing this might work:
X var Byte
Y var Byte
Y=1 'Now Y=%00000001
For x=0 to 6 Step 1
Y=Y << 1 'Shift Y left one time, Y=%00000010,Y=%00000100,Y=%00001000
Next x
This command is also usefull when combining nibbles and other stuff, shift happily left or right as you see fit.





Bookmarks