If you want to preserve the bits already there, then you need to do a read/modify/write type operation.
Code:
int temp = reg; // read your register
temp = temp & 0x1F; // mask off all the bits you want to change
temp = temp | (new_value << 5); // add your new bits, shifted into the correct place
reg = temp; // assign back to your reg.
> If the latter you can define it as a bit field
If its an internal data structure, then this is OK, but it's far from portable if its an external register/data structure.
The layout of bit fields is compiler specific.