能力值:
( LV2,RANK:10 )
|
-
-
|
能力值:
( LV2,RANK:10 )
|
-
-
一个疑问,按地址调用的汇编码?
我不用pascal的,所以我写了一个C++的程序模拟那个Pascal过程:
void MyAdd2(int y, int x, int& res) //考虑了C++和Pascal传递的顺序不同
{
res = x + y;
}
反汇编的结果:
00401290 /$ 55 PUSH EBP
00401291 |. 89E5 MOV EBP,ESP
00401293 |. 8B45 0C MOV EAX,DWORD PTR SS:[EBP+C]
00401296 |. 8B55 08 MOV EDX,DWORD PTR SS:[EBP+8]
00401299 |. 01D0 ADD EAX,EDX
0040129B |. 8B55 10 MOV EDX,DWORD PTR SS:[EBP+10] ; 取ret, 注意不是lea eax, ...
0040129E |. 8902 MOV DWORD PTR DS:[EDX],EAX
004012A0 |. 5D POP EBP
004012A1 \. C3 RETN
|