clean code in cpu_port.c, add some comments