The OP show switch connected on RA<5:2>
>>2 : yes it's divide by 4... but also easier to figure out when you use the 'Shift it 2 positions to right' term. Here it will shift the whole PORTA reading, 2 bits to the right... hence remove PORTA<1:0>
the & $0F is indeed a Bitwise AND. This way it keep only bits <3:0>... here PORTA<5:2> once shifted to the right.
Code:
76543210
Index= %10101111
Index=Index >>2 ' now %00101011
Index=Index & $0F ' now %00001011
Last edited by mister_e; - 16th January 2008 at 07:25.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks