C++里加汇编的BUG

pengyan 2007-04-13 05:13:57
DWORD temp=0xff;
_asm{
mov dx cf8H
mov ax 80011001H
out dx ax
mov dx cfcH
in ax dx
mov temp ax
}
DbgLogInfo(("temp %0x\n",temp));
...全文
763 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
pengyan 2007-04-13
  • 打赏
  • 举报
回复
加了,但又有问题了
     DWORD temp=0xff;
_asm{
mov dx, cf8H
mov ax, 80011001H
out dx , ax
mov dx , cfcH
in ax , dx
mov temp, ax
}
DbgLogInfo(("temp %0x\n",temp));

F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(298) : error C2443: operand size conflict
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(301) : error C2443: operand size conflict
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(303) : error C2443: operand size conflict

mLee79 2007-04-13
  • 打赏
  • 举报
回复
偶晕, mov dx [[,]] cf8H 指令里的 ',' 分隔符难道都被lz吃了 ...
这东东在 win32 user mode 下也是跑不起来的, 不 GP 才怪 ....
pengyan 2007-04-13
  • 打赏
  • 举报
回复
为什么会错呢?
pengyan 2007-04-13
  • 打赏
  • 举报
回复
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(298) : error C2400: inline assembler syntax error in 'first operand'; found 'newline'
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(298) : error C2414: illegal number of operands
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(298) : error C2400: inline assembler syntax error in 'second operand'; found 'constant'
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(299) : error C2400: inline assembler syntax error in 'opcode'; found 'constant'
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(299) : warning C4405: 'out' : identifier is reserved word
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(301) : error C2400: inline assembler syntax error in 'first operand'; found 'newline'
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(301) : error C2414: illegal number of operands
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(301) : error C2400: inline assembler syntax error in 'second operand'; found 'register'
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(302) : error C2400: inline assembler syntax error in 'opcode'; found 'register'
F:\working\cx23880.5.0.18.0.src\avvcap\DVBSDemod.cpp(302) : warning C4405: 'mov' : identifier is reserved word
DVBTDemod.cpp

64,643

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧