虽然意思是,但是还是不明白为啥:
char 既不是 signed char 类型,也不是 unsigned char 类型;char是否为具符号类型是实现定义的;
这个还是不一样的吧?最起码扩展传送指令是不一样的
signed char a;
a = 99;
00253C3E
mov
byte ptr [a],63h
a += 1;
00253C42
movsx eax,byte ptr [a]
EAX = 00000063 EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C46 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000206
00253C46
add
eax,1
EAX = 00000064 EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C49 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000202
00253C49
mov
byte ptr [a],al
//printf("%d", a);
unsigned char b;
b = 99;
00253C4C
mov
byte ptr [b],63h
b += 1;
00253C50
movzx eax,byte ptr [b]
EAX = 00000063 EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C54 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000202
00253C54
add
eax,1
EAX = 00000064 EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C57 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000202
00253C57
mov
byte ptr [b],al
//printf("%d", b);
signed char c;
c = 156;
00253C5A
mov
byte ptr [c],9Ch
c += 1;
00253C5E
movsx eax,byte ptr [c]
EAX = FFFFFF9C EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C62 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000202
00253C62
add
eax,1
EAX = FFFFFF9D EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C65 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000282
00253C65
mov
byte ptr [c],al
//printf("%d", c);
unsigned char d;
d = 156;
00253C68
mov
byte ptr [d],9Ch
d += 1;
00253C6C
movzx eax,byte ptr [d]
EAX = 0000009C EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C70 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000282
00253C70
add
eax,1
EAX = 0000009D EBX = 7F16E000 ECX = 00000000 EDX = 00259580 ESI = 00251046 EDI = 00DCFC40 EIP = 00253C73 ESP = 00DCFB44 EBP = 00DCFC40 EFL = 00000202
00253C73
mov
byte ptr [d],al