微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Linux上_emit的等价物是什么?

我正在尝试将一些用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");

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐