++b 和 a++ 的区别 看汇编代码
汇编代码解释如下
int x = a++;
00F08833 8B 45 F8 mov eax,dword ptr [a]
00F08836 89 45 E0 mov dword ptr [x],eax
00F08839 8B 4D F8 mov ecx,dword ptr [a]
00F0883C 83 C1 01 add ecx,1
00F0883F 89 4D F8 mov dword ptr [a],ecx
int y = ++b;
00F08842 8B 45 EC mov eax,dword ptr [b]
00F08845 83 C0 01 add eax,1
00F08848 89 45 EC mov dword ptr [b],eax
00F0884B 8B 4D EC mov ecx,dword ptr [b]
00F0884E 89 4D D4 mov dword ptr [y],ecx
循环中的
while (guest ++ < 10)
00BC8987 8B 45 C8 mov eax,dword ptr [guest]
00BC898A 89 85 00 FF FF FF mov dword ptr [ebp-100h],eax
00BC8990 8B 4D C8 mov ecx,dword ptr [guest]
00BC8993 83 C1 01 add ecx,1
00BC8996 89 4D C8 mov dword ptr [guest],ecx
00BC8999 83 BD 00 FF FF FF 0A cmp dword ptr [ebp-100h],0Ah
00BC89A0 7D 0C jge __$EncStackInitStart+1D2h (0BC89AEh)
00BC89A2 C7 85 FC FE FF FF 01 00 00 00 mov dword ptr [ebp-104h],1
00BC89AC EB 0A jmp __$EncStackInitStart+1DCh (0BC89B8h)
00BC89AE C7 85 FC FE FF FF 00 00 00 00 mov dword ptr [ebp-104h],0
00BC89B8 83 BD FC FE FF FF 00 cmp dword ptr [ebp-104h],0
00BC89BF 74 41 je __$EncStackInitStart+226h (0BC8A02h)