You could bitwise xor the read of port A with a saved previous state. Then changed bits would be set. Then you could use a SELECT CASE to do actions if a specific bit is set


casetest = portA ^ prev_state

prev_case = portA

SELECT CASE casetest
CASE casetest.BIT0
( do stuff for bit 0 changes)
CASE casetest.BIT1
(do stuff for bit 1 changes)
etc, etc.