- 论坛徽章:
- 0
|
回复 1# _HellAngel_ - 146: c = s[i];
- 0040111D mov ecx,dword ptr [ebp+8]
- 00401120 add ecx,dword ptr [ebp-8]
- 00401123 movsx edx,byte ptr [ecx]
- 00401126 mov dword ptr [ebp-4],edx
- 147: s[i] = s[j];
- 00401129 mov eax,dword ptr [ebp+8]
- 0040112C add eax,dword ptr [ebp-8]
- 0040112F mov ecx,dword ptr [ebp+8]
- 00401132 add ecx,dword ptr [ebp-0Ch]
- 00401135 mov dl,byte ptr [ecx]
- 00401137 mov byte ptr [eax],dl
- 148: s[j] = c;
- 00401139 mov eax,dword ptr [ebp+8]
- 0040113C add eax,dword ptr [ebp-0Ch]
- 0040113F mov cl,byte ptr [ebp-4]
- 00401142 mov byte ptr [eax],cl
- 149: }
- 00401144 jmp reverse+33h (00401103)
复制代码- 152: c = s[i], s[i] = s[j], s[j] = c;
- 0040111D mov ecx,dword ptr [ebp+8]
- 00401120 add ecx,dword ptr [ebp-8]
- 00401123 movsx edx,byte ptr [ecx]
- 00401126 mov dword ptr [ebp-4],edx
- 00401129 mov eax,dword ptr [ebp+8]
- 0040112C add eax,dword ptr [ebp-8]
- 0040112F mov ecx,dword ptr [ebp+8]
- 00401132 add ecx,dword ptr [ebp-0Ch]
- 00401135 mov dl,byte ptr [ecx]
- 00401137 mov byte ptr [eax],dl
- 00401139 mov eax,dword ptr [ebp+8]
- 0040113C add eax,dword ptr [ebp-0Ch]
- 0040113F mov cl,byte ptr [ebp-4]
- 00401142 mov byte ptr [eax],cl
- 00401144 jmp reverse+33h (00401103)
复制代码 两种情况用VC反汇编结果是一样的,书上说注意使用逗号,个人理解应该是指在复杂的表达式中使用,
有可能造成你以为的优先级与实际的优先级不一致。只要优先级及从左到右或从右到左都理解正确是可以使用的,
只是记这些比较麻烦而已。在本例中显然没有问题,比较简单。 |
|