????c++?е???????????
???????????? ???????[ 2013/5/24 9:53:45 ] ????????
??????????????????????X?????????????????(???????????????????)????????????á?
????????????????????????????????麯?????????????????????????麯???????????????????????Ρ????????????????????£????????????????????????????????????????á?
?????????????????Σ???X???????Y????Y??????????????????????????????????????????
??????????c++???
class Y {
private:
int j;
public:
Y(const Y& y) {}
Y() {};//?????Y???????????????????????
};
class X : public Y {
private:
int i;
int j;
};
int main() {
X x1;//????????x1
X x2 = x1;//??x1??????x2
}
??????????mian??????????
; 16 : int main() {
push ebp
mov ebp?? esp
sub esp?? 24 ; ?x1 x2???24byte???
; 17 : X x1;//????????x1
lea ecx?? DWORD PTR _x1$[ebp];???x1??????????????????????????????
call ??0X@@QAE@XZ;//????????????X????????????
; 18 : X x2 = x1;//??x1??????x2
lea eax?? DWORD PTR _x1$[ebp];???x1?????????????????eax
push eax;??eax?????????????X????????????????
lea ecx?? DWORD PTR _x2$[ebp];???x2?????????????????X???????????????????
call ??0X@@QAE@ABV0@@Z;?????????????????????????
; 19 : }
xor eax?? eax
mov esp?? ebp
pop ebp
ret 0
????????????X?????????????????
??0X@@QAE@ABV0@@Z PROC ; X::X?? COMDAT
; _this$ = ecx
push ebp
mov ebp?? esp
push ecx
mov DWORD PTR _this$[ebp]?? ecx;ecx??????x2??????
mov eax?? DWORD PTR ___that$[ebp];??x1????????eax
push eax;??eax?????????????????????????????????
mov ecx?? DWORD PTR _this$[ebp];??x2????????ecx???????????????????????????????
call ??0Y@@QAE@ABV0@@Z ; ???????????????
mov ecx?? DWORD PTR _this$[ebp];???x2????????ecx
mov edx?? DWORD PTR ___that$[ebp];???x1????????edx
mov eax?? DWORD PTR [edx+4];?????x1????4byte?????????????д??eax??????x1????????????i???д??eax?????x1???????????????????????i?????
;?????????????????????x2
mov DWORD PTR [ecx+4]?? eax;??eax???д?????x2????4byte??????????棬????eax???д??x2????????????i?????x2????????????????????i?????
;???????????????????
mov ecx?? DWORD PTR _this$[ebp];??x2????????ecx
mov edx?? DWORD PTR ___that$[ebp];??x1????????edx
mov eax?? DWORD PTR [edx+8];?????x1????8byte???????????????eax??????x1????????????j?????eax
mov DWORD PTR [ecx+8]?? eax;??eax???д?????x2????8byte????????棬????eax???д??x2??????j??
mov eax?? DWORD PTR _this$[ebp];??x2????????eax????????????????????????????????
mov esp?? ebp
pop ebp
ret 4
??0X@@QAE@ABV0@@Z ENDP
???????????п???????????????????X??????????????????????????????????á????????????X????????????У????????????????????????????????е??????????????????????е?????????
?????????????Y?е???????????????
??0Y@@QAE@ABV0@@ZPROC ; Y::Y?? COMDAT
; _this$ = ecx
; 5 : Y(const Y& y) {}
push ebp
mov ebp?? esp
push ecx;//??????????????????????????????????this(??x2??????)
mov DWORD PTR _this$[ebp]?? ecx;ecx???溬??x2??????(??this)??????????????
mov eax?? DWORD PTR _this$[ebp];??x2??????д??eax????????????????????????????????
mov esp?? ebp
pop ebp
ret 4
??0Y@@QAE@ABV0@@Z ENDP ; Y::Y
_TEXT ENDS
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11