c++ - 在 Intel Compiler-FASM 中内联汇编?

标签 c++ assembly x86 intel

如果您希望在 C++ 中编写内联汇编(在使用英特尔编译器编译 C++ 时),您会使用哪种汇编语法?是 FASM/NASM 还是 MASM?这与您使用的操作系统有关系吗(或者英特尔编译器是否抽象出这种差异)?

最佳答案

根据 Intel , 英特尔® C++ 编译器同时支持 Microsoft 风格和 GNU 风格的内联汇编:

Inline Assembly

Microsoft* Style Inline Assembly

The Intel® C++ Compiler supports Microsoft-style inline assembly. See the Microsoft documentation for the proper syntax.

GNU*-like Style Inline Assembly (IA-32 architecture and Intel® 64 architecture only)

The Intel® C++ Compiler supports GNU-like style inline assembly. The syntax is as follows:

asm-keyword [ volatile-keyword ] ( asm-template [ asm-interface ] ) ;

NOTE

The Intel® C++ Compiler supports gcc-style inline ASM if the assembler code uses AT&T* System V/386 syntax.

关于c++ - 在 Intel Compiler-FASM 中内联汇编?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15510797/

相关文章:

处理负整数的汇编 MASM

x86 - NASM x86 : send system call interpreting payload to send as NULL

c - 在 gcc 内联汇编中加载寄存器? (简单的?)

c++ - 使用类绑定(bind)功能调用成员函数

c++ - 返回对 std::vector 元素的引用会导致崩溃

assembly - Mic1,微汇编语言,创建乘法器

c - MIPS 汇编到 C

c++ - 字节数组转 UTF8 CString

c++ - 将浮点值映射到一对键

assembly - 这些错误是什么意思?汇编语言