Example:

The bits I need to set to display the "0" digit on the 7 segments display are:

on porta: %***01* , all other bits are left untouched
on portc: %*11111 , bit 5 is left untouched.

I have two arrays of bytes:
cval VAR BYTE[10] and aval VAR BYTE[10], each index represents a duet of bytes containing the bits configuration to display a digit.
arrays index 0 for digit "0",... up to digit "9" in index 9.

I only need to 'insert' chunks of bits in porta and portc registers.


For a given array index (representing the 7 bits to make a digit):
For porta I will need to replace bits 1 and 2 from porta by bits 1 and 2 from aval variable.
For portc I will need to replace bits 4 to 0 from portc by bits 4 to 0 from cval variable

is this clear ???