search 32 bit binary for the 1's and return a 1 to the placeholder variable

Folks ,
I have a korn shell script that i have written for assembly, the variable that is a final result is returning hexadecimal, now the value is to be converted to binary and return the place holder in the binary that has a 1 in its place and send it to a variable assigned for the place...
Can you all take a look at this and suggest me some example scripts.....

Thank You
Venu
for example .....

EXAMPLE ......Hex = ABCDEFGH

EXAMPLE......RETURN = 10101010101010000000000000000000
THEN CHECK FROM RIGHT TO LEFT CHECK FOR THE PLACE HOLDER THAT HAS A "1" SO ON TILL B32 and return the results to the appropriate variable for example :
B1 = 1
B2 = 0
B3 = 1
B4=0
B5=1
B6=0
B7=1....and so on till b32