Semiconductor memory and control method to