vc中嵌入汇编的一个问题?

lizilily lizilily 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想在vc中加入下面的汇编语言程序,这是我的汇编程序,void HDOutWord(WORD Addr,WORD Value)
{
asm{
push dx
push ax
mov dx,Addr
mov ax,Value
#ifndef _DEBUG_HD_
out dx,ax
#endif
pop ax
pop dx
}
}
结果编译时候出现错误:
E:\2004.8.26\Control.cpp(15) : error C2065: 'push' : undeclared identifier
E:\2004.8.26\Control.cpp(15) : error C2146: syntax error : missing ';' before identifier 'dx'
E:\2004.8.26\Control.cpp(15) : error C2065: 'dx' : undeclared identifier
E:\2004.8.26\Control.cpp(15) : error C2146: syntax error : missing ';' before identifier 'push'
E:\2004.8.26\Control.cpp(16) : error C2146: syntax error : missing ';' before identifier 'ax'
E:\2004.8.26\Control.cpp(16) : error C2065: 'ax' : undeclared identifier
E:\2004.8.26\Control.cpp(16) : error C2146: syntax error : missing ';' before identifier 'mov'
E:\2004.8.26\Control.cpp(16) : error C2065: 'mov' : undeclared identifier
等等,我不知道这是什么原因,是没有包含头文件之类吗?若是应该是什么文件?
...全文
评论 3
收藏 已收藏
分享
返回顶部
lizilily
硬件/系统 2,644 成员 17,229 内容