我无法在Visual C Express Edition 2008中汇编movd(MMX)指令 [英] I can't assemble movd (MMX) instruction in my visual c express ediion 2008

查看:58
本文介绍了我无法在Visual C Express Edition 2008中汇编movd(MMX)指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试编译 moved 指令时,它显示错误为

when I try to compile movd instruction it is showing error as

error A2085:instruction or register not accepted in current CPU mode

我的代码如下:

.386                
.model flat, c                                           
.code

add_func_asm PROC                                                 
movd     eax, ebx
ret    
add_func_asm endp

END

这是 .asm 文件,我从 C 文件

我通过使用以下代码对其进行了修复

I fixed it by using below code

.586    
.mmx            
.model flat, c                                           
.code                          
add_func_asm PROC                                                 
movd     mm1, ebx
ret    
add_func_asm endp

END

推荐答案

.386

那行不通,386处理器没有此指令.您必须以.586(奔腾及更高版本)为目标,并明确声明要使用MMX指令集.修复:

That cannot work, the 386 processor didn't have this instruction. You have to target .586 (Pentium and up) and explicitly state that you want to use the MMX instruction set. Fix:

.586
.mmx

这将使汇编器接受MOVD指令.接下来,您需要修复操作数.从ebx转到eax无效,毫无意义,您必须指定MMx寄存器.

That will get the assembler to accept the MOVD instruction. Next thing you'll have to do is fix the operands. Moving from ebx to eax is not valid, and pointless, you'll have to specify an MMx register.

这篇关于我无法在Visual C Express Edition 2008中汇编movd(MMX)指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆