fix bugs,can not use c to setup Mem's register