which bit is set in a byte?

I'd like to get a number from 0 to 7 telling me which input has caused the interrupt

How do you subsequently use the numbers 0 to 7 ?