dos中如何获取当前段
我正在尝试使用c语言获取cs(当前段)寄存器值。我通过以下代码尝试了海湾汇编器:
__asm__("movw %%eax, %%ecs;" : "=r" ( cur_seg ));
but my project did not recognise __asm__. May be there is other way to this? Please help.I am trying to get cs (current segment) register value by using c language. I tried it bay assembler by this code:
__asm__("movw %%eax, %%ecs;" : "=r" ( cur_seg ));
but my project did not recognise __asm__. May be there is other way to this? Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的代码是gcc特定的,你在dos下使用gcc吗?如果没有尝试使用 __asm {}、_asm {} 或 asm {} 语法。如需了解更多信息,请访问 http://msdn.microsoft.com /en-us/library/45yd4tzz(v=vs.80).aspx, http://www.daniweb.com/software-development/cpp/threads/4927,
Your code is gcc-specifics, are you using gcc under dos? If not try to use __asm {}, _asm {} or asm {} syntax. See more at http://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.80).aspx, http://www.daniweb.com/software-development/cpp/threads/4927,