Sometimes a bunch of ANDs will cause some trouble.
Might try just reading the port
if porb = %00000000 then