牵着老婆满街逛

严以律己,宽以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

C++博客 首页 新随笔 联系 聚合 管理
  915 Posts :: 45 Stories :: 565 Comments :: 0 Trackbacks
来源:http://blog.csdn.net/solstice/archive/2006/02/06/592890.aspx

最近需要读写 png 文件,按照以前的办法试验,却发现无法编译zlib 1.2.3。出错信息为:

inffas32.asm(594) : error A2070: invalid instruction operands
inffas32.asm(596) : error A2070: invalid instruction operands
inffas32.asm(610) : error A2070: invalid instruction operands
inffas32.asm(667) : error A2070: invalid instruction operands

上网一查,发现别人也遇到相同的问题:http://svn.haxx.se/dev/archive-2005-11/0942.shtml。原因在于

It (Microsoft Macro Assembler 8.0, included with Visual C++ 2005 Express ) refuses to assemble a MOVD instruction with a memory operand with an implied size, and requires that "dword ptr" prefix the memory operand.

微软说这是by design,不是bug:

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6306f7dc-2cc2-4591-bd60-5d802178fdfa

解决办法是把inffas32.asm中的4处出错的类似

 movd mm4, [esp+0]

的汇编代码,添加dword ptr修饰符,改为

 movd mm4,dword ptr [esp+0]

这样就能顺利编译、通过测试了。



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=592890



posted on 2007-10-12 10:40 杨粼波 阅读(1136) 评论(1)  编辑 收藏 引用

Feedback

# re: Zlib在VS2005下编译ASM版本出A2070错误的解决办法 2008-12-09 19:26 jasmineluo
我今天一直在解错
因为错误太多
在网上找了很多资料
可是没有一个像你讲解的这样清楚的
所以忍不住谢谢你
  回复  更多评论
  


专题:Android  iPad jQuery Chrome OS

博客园首页  IT新闻  知识库  学英语  C++程序员招聘
标题  
姓名  
主页
验证码 *
内容(提交失败后,可以通过“恢复上次提交”恢复刚刚提交的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
[使用Ctrl+Enter键可以直接提交]
每天10分钟,轻松学英语
网站导航: