打印十六进制字符串查看内存地址
void puthex(unsigned long val) { /* val = 0x1234ABCD */ unsigned char c; int i = 0; putc('0'); putc('x'); for (i = 0; i < 8; i++) { c = (val >> ((7-i)*4)) & 0xf; if ((c >= 0) && (c <= 9)) { c = '0' + c; } else if ((c >= 0xA) && (c <= 0xF)) { c = 'A' + (c - 0xA); } putc(c); } }