VS下i++与++i的区别

	int i=5;
00C3186E movdwordptr[i],5
	;i++;
00C31875 moveax,dwordptr[i]
00C31878 add eax,1
00C3187B mov dword ptr[i],eax
	;++i;     
00C3187E mov eax,dword ptr[i]
00C31881 add eax,1
00C31884 mov dword ptr[i],eax
	;int mm;
	;mm=++i;
00C31887 mov eax,dword ptr[i]
00C3188A add eax,1
00C3188D mov dword ptr[i],eax
00C31890 mov ecx,dword ptr[i]
00C31893 mov dword ptr[mm],ecx
	;mm=i++;
00C31896 mov eax,dword ptr[i]
00C31899 mov dword ptr[mm],eax
00C3189C mov ecx,dword ptr[i]
00C3189F add ecx,1
00C318A2 mov dword ptr[i],ecx

	;mm=++i+i++;
00C318A5 mov eax,dword ptr[i]
00C318A8 add eax,1
00C318AB mov dword ptr[i],eax
00C318AE mov ecx,dword ptr[i]
00C318B1 add ecx,dword ptr[i]
00C318B4 mov dword ptr[mm],ecx
00C318B7 mov edx,dword ptr[i]
00C318BA add edx,1
00C318BD mov dword ptr[i],edx
Tagged with: , ,

发表评论

邮箱地址不会被公开。 必填项已用*标注

*