來源: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