该错误位于12页
如下:
Then there are only three lines of asm back to explain.
这三行返回代码需要解释一下:
{
pop ecx
pop ecx
pop ebp
}
end;
These are removing the stack frame, by restoring the values of esp and ebp back
to the values they had when the function was entered. This code is much more
intuitive and does the same thing
add esp, 4
pop ebp
it is also more effective and I do not know why the compiler is incrementing the
stack pointer in this cumbersome way. Remember that ecx can be used for free and
assigning values to it is just like pouring them into a waste bucket.
它们弹出堆栈,恢复进入函数时保存的 esp、ebp 的值。更形象的表示如下
add esp, 4
pop ebp
这也是更有效率的。我不知道为什么编译器用那样麻烦的方法增加堆栈指针。
记得 ecx 可以被自由使用和复制,pop ecx 看起来像把数据放到了垃圾桶。
很明显
pop ecx
pop ecx
pop ebp
应该等同于
add esp,8
pop ebp
才对