I have used this code in my own program to sum different registers together with success, but I would like to choose between 16 options. I know I need to mask the POT register with 4 bits, but I am a little confused. My stab at it is it would be something like?
Code: Select all
rdax pot0,1
and %01111000_00000000_00000000
skp zro, sum1
sof 1, -0.0625
skp zro, sum2
sof 1, -0.0625
skp zro, sum3
...
sof 1,-0,0625
skp zrp, sum16
clr
Any help on what bits to AND and what number to subtract to get 16 combinations would be great! I tried expanding the code to 8 combinations to get started but it wasn't working as expected so I think I'm not understanding the fundamentals fully on this one...
Thanks!