register value overwritten by INVOKE
来源:互联网 发布:华育杯好作文网络征集 编辑:程序博客网 时间:2024/06/18 14:39
假设在一个子程序中有如下invoke指令:
invoke Test, eax, addr szHello
其中Test是一个需要两个参数的子程序,szHello是一个局部变量,会发生什么结果呢?编译器会把invoke伪指令和addr翻译成下面这个模样:
lea eax,[ebp-4]
push eax ;参数2:addr szHello
push eax ;参数1:eax
call Test
发现了什么?到push第一个参数eax之前,eax的值已经被lea eax,[ebp-4]指令覆盖了!也就是说,要用到的eax的值不再有效,所以,当在invoke中使用addr伪操作符时,注意在它的前面不能用eax,否则eax的值会被覆盖掉,当然eax在addr的后面的参数中用是可以的。
幸亏MASM编译器对这种情况有如下错误提示:
error A2133: register value overwritten by INVOKE
否则,不知道又会引出多少莫名其妙的错误!
invoke Test, eax, addr szHello
其中Test是一个需要两个参数的子程序,szHello是一个局部变量,会发生什么结果呢?编译器会把invoke伪指令和addr翻译成下面这个模样:
lea eax,[ebp-4]
push eax ;参数2:addr szHello
push eax ;参数1:eax
call Test
发现了什么?到push第一个参数eax之前,eax的值已经被lea eax,[ebp-4]指令覆盖了!也就是说,要用到的eax的值不再有效,所以,当在invoke中使用addr伪操作符时,注意在它的前面不能用eax,否则eax的值会被覆盖掉,当然eax在addr的后面的参数中用是可以的。
幸亏MASM编译器对这种情况有如下错误提示:
error A2133: register value overwritten by INVOKE
否则,不知道又会引出多少莫名其妙的错误!
0 0
- register value overwritten by INVOKE
- Some untracked working tree files would be overwritten by Pull
- By value? Or by reference?
- sorting map by value
- Revisit pass by value
- Map sort by value
- map order by value
- get register by address instead of name
- Vue avoid mutating a prop directly since the value will be overwritten
- [Vue warn]: Avoid mutating a prop directly since the value will be overwritten
- Vue:Avoid mutating a prop directly since the value will be overwritten ...警告解决方法
- error: The following untracked working tree files would be overwritten by merge
- git pll and notice: untracked working tree files would be overwritten by merge
- git checkout : You have local changes cannot switch branches&Entry would be overwritten by mege
- Some of your uncommitted changes would be overwritten by syncing.Please commit your changes then try
- Error pulling origin: error: Your local changes to the following files would be overwritten by merge
- Error pulling origin: error: The following untracked working tree files would be overwritten by...
- Git pull error:Your local changes to the following files would be overwritten by merge解决方法
- url参数以及url的编码解码
- PLSQL:做实验代码模板
- 图形学第一课--听James D. Foley教授讲座后的一些感受
- 魔法矩阵c++实现(nil)
- 最短路径条数(floyd)
- register value overwritten by INVOKE
- *** stack smashing detected ***
- 超出范围的函数
- BestCoder Round #13 1003(单调性DP)HDU5064
- 函数是试图
- Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- python : 批量下载R语言库包
- 返回局部变量
- 图像细化