Implement register_temp.