I am trying to read a 32 register,modify its first 8 bits[BIT7:BIT0] and write back its value. Does the code below achieve that?
reg_val = register_read(register_object);
reg_val = ((reg_val & 0xffffff00) | new_value));
register_write(register_object,reg_val);
Also is it the most efficient way to achieve that.any suggestions or comments are appreciated.
new_value < 256:)