changed prototype to register_set(reg, value)