考试二级C++辅导(四)

再来看看相应的汇编码:

  5: int a = 20;

  00401028 mov dword ptr [ebp-4],14h

  6: int & b = a;

  0040102F lea eax,[ebp-4]

  00401032 mov dword ptr [ebp-8],eax

  7: b ++;

  00401035 mov ecx,dword ptr [ebp-8]

  00401038 mov edx,dword ptr [ecx]

  0040103A add edx,1

  0040103D mov eax,dword ptr [ebp-8]

  00401040 mov dword ptr [eax],edx

  8: printf("==== %d ====\r\n", b);

  00401042 mov ecx,dword ptr [ebp-8]

  00401045 mov edx,dword ptr [ecx]

  00401047 push edx

  00401048 push offset string "==== %d ====\r\n" (0042801c)

  0040104D call printf (004012a0)

  00401052 add esp,8

  9: }

  可以看出, 这两段汇编码完全一样.

上一篇:54.instanceof关键字的使用


下一篇:反汇编2