如果您希望在 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/