I am driving a 7-segment display with an HC4511 BCD to 7-segment decoder.

The input of the 4511 is connected to PORTB 0-3.

I have a byte value that contains the number I want to display.

Would something like this work?

Code:
portB.0 = MyByte.Bit0
portB.1 = MyByte.Bit1
PortB.2 = MyByte.Bit2
PortB.3 = MyByte.Bit3
In other words, would the lower 4 bits of PORTB follow what my byte is doing? When I update my byte, would PORTB then change to reflect the new value? Or am I on the wrong track here?

If I am on the wrong track, how do I make the lower 4 bits of PORTB mirror the lower 4 bits of my byte, without affecting the upper 4 bits of PORTB? The upper 4 are being used for other things.

Thanks,

Andy