Code:
w = portd
portb = w & b00001111
w = w >> 4
portc = w
Maybe that’s a more appropriate answer
PBP can’t do anything that can’t be done in assembler.
No need to ever check anything unless there are possible values you want to discount.