atomic execution of register writes