编程语言
首页 > 编程语言> > 考试二级C++辅导(四)

考试二级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: }

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

标签:eax,mov,C++,辅导,ebp,dword,edx,ptr,考试
来源: https://blog.csdn.net/weixin_63757008/article/details/121729082