   mov  r4,#6
   call setb_ind
   ...
setb_ind:
   push b
   mov  b,r4
   jb   b.2,setb_in_1xx
   jb   b.1,setb_in_01x
   jb   b.0,setb_in_001
   orl  a,#1
   pop  b
   ret
setb_in_001:
   orl  a,#2
   pop  b
   ret
setb_in_01x:
   jb   b.0,setb_in_011
   orl  a,#4
   pop  b
   ret
setb_in_011:
   orl  a,#8
   pop  b
   ret
... etc.etc.
