I've changed enc_a to portb.4 and enc_b to portb.3, but I guess I also have to modify re = porta&12 ? to what it set?
its a simple binary mask used to select only the port pin data from the two pins of interest
the mask value is 2 to power of enc_a.bit + 2 to power of enc_b.bit.


you also need to shift the data gathered into bits 0 and 1 for proper evaluation