加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux上_emit的等价物是什么?

发布时间:2020-12-14 02:23:34 所属栏目:Linux 来源:网络整理
导读:我正在尝试将一些用Visual Studio编写的汇编代码移植到 Linux上的GNU内联汇编中.原始代码使用 _emit,MSDN将其描述为伪指令,并解释为: The _emit pseudoinstruction is similar to the DB directive of MASM. You use _emit to define a single immediate by
我正在尝试将一些用Visual Studio编写的汇编代码移植到 Linux上的GNU内联汇编中.原始代码使用 _emit,MSDN将其描述为伪指令,并解释为:

The _emit pseudoinstruction is similar to the DB directive of MASM. You use _emit to define a single immediate byte at the current location in the current text segment. However,_emit can define only one byte at a time,and it can only define bytes in the text segment. It uses the same syntax as the INT instruction.

我怎样才能在Linux上做同样的事情?

解决方法

要发出字节0x12(例如),请执行:
asm __volatile__ (".byte 0x12");

虽然,启用优化后可能会得到令人惊讶的结果.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读