环境为:win2000+VC6
以下源码:
_asm
{
xor eax,1
add eax,2
jnz label1
jz label1
db 0E8h ;<----出错,说inline assembler syntax error in 'opcode'; found 'constant'
label1:
xor eax,3
add eax,4
xor eax,5
}
以下源码:
_asm
{
xor eax,1
add eax,2
jnz label1
jz label1
db 0E8h ;<----出错,说inline assembler syntax error in 'opcode'; found 'constant'
label1:
xor eax,3
add eax,4
xor eax,5
}
解决方案 »
- 向大家请教一个两线程操作同一文件的问题 希望能够得到大家的帮助 名字要够长才行再长还要长还有35个字符快了ok差不多可以了
- DLL怎么传递字符串
- 一个PDF格式的文档,但是不允许打印,怎么办?大家有什么办法可以使这个文档打印吗?
- 如何得到系统磁盘的盘符及动态添加的U盘和移动硬盘,大家帮忙啊!(在线等哦)
- ocx和dll文件有什么区别吗??
- [思考]如何让日期时间控件不显示时间,直接显示字符串"YYYY-MM-DD"
- MFC开发ActiveX问题
- NT系统服务程序的问题,高手请进!(在线100)
- 关于listen的最大连接
- 低级问题,如何在图片框里放置GIF图片
- VC6中Combo控件简单问题请教
- 高分请教!~~~
在vc的嵌入式汇编里头不能用以下摘自msdnData Directives and Operators in Inline Assembly
Home | Overview | How Do IAlthough an __asm block can reference C or C++ data types and objects, it cannot define data objects with MASM directives or operators. Specifically, you cannot use the definition directives DB, DW, DD, DQ, DT, and DF, or the operators DUP or THIS. MASM structures and records are also unavailable. The inline assembler doesn’t accept the directives STRUC, RECORD, WIDTH, or MASK.
--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
db 0x0E8
~~
(1)用 db 0x0E8 还是不行的;
(2)用_emit就可以了,不论是用 _asm{ } 块结构,还是每行都用 _asm 前缀,都行。不论给出的答案正确与否,见者有份都会给分,答案正确者会多点。想再问一下,_emit 0xE8 也是定义一个byte吗?如果不是的话,整个这段代码就失去了它的意义。
_emit 0xE8
_emit 0xE9
就是等价的,对吧?