vc中嵌入汇编的一个问题?
我想在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
等等,我不知道这是什么原因,是没有包含头文件之类吗?若是应该是什么文件?
{
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
等等,我不知道这是什么原因,是没有包含头文件之类吗?若是应该是什么文件?
...全文
相关推荐
调用汇编代码_me.rar_C 调用 汇编_VC 中嵌入汇编_VC 汇编_汇编语言
**VC中嵌入汇编** Visual C++支持在C/C++源代码中直接嵌入汇编语句,通过使用`__asm`关键字。
VC内联汇编资料 VC内联汇编资料
总结来说,VC内联汇编是一种强大的工具,它为开发者提供了直接操纵硬件的能力,但也带来了可移植性和维护性的问题。
vc嵌入汇编,调用资源优化
在VC++(Visual C++)开发环境中,嵌入汇编是一种技术,允许程序员在C/C++代码中直接使用汇编语言,以实现特定性能优化或访问底层硬件功能。
用vc6开发汇编语言程序的方法
首先,要安装VC6.0,建议使用英文原版,因为非官方的中文版可能存在问题。
vc6 支持汇编.rar
在VC6中,我们可以使用内联汇编(Inline Assembler)来将汇编代码嵌入到C++程序中,这样可以在需要高性能或直接硬件访问的场合提高程序效率。


硬件/系统
