Assembly MSVC x86内联汇编程序开关语句

Assembly MSVC x86内联汇编程序开关语句,assembly,Assembly,如何在内联汇编语言中声明跳转表? 我想做下面的代码,但msvc不接受dd行 我还尝试了\u asm\u emit offset label1,但它只输出1个字节 \u asm\u emit(偏移量标签1)>>8也不编译,所以我不能一次编译一个字节 _asm { jmp skiptable jmptable: dd offset label1 dd offset label2 skiptable: jmp [table + 4*eax] label1:

如何在内联汇编语言中声明跳转表? 我想做下面的代码,但msvc不接受dd行

我还尝试了
\u asm\u emit offset label1
,但它只输出1个字节

\u asm\u emit(偏移量标签1)>>8
也不编译,所以我不能一次编译一个字节

_asm {
    jmp skiptable

jmptable:
    dd offset label1
    dd offset label2

skiptable:
    jmp [table + 4*eax]

label1:
    ....

label2:
    ....
}

不幸的是_asm是实际程序集的一个子集。您不能使用数据指令,正如您所注意到的,emit只执行一个字节

从Microsoft的文档:

Although an __asm block can reference C or C++ data types and objects, it
cannot define data objects with MASM directives or operators. Specifically,
you cannot use the definition directives DB, DW, DD, DQ, DT, and DF, or the
operators DUP or THIS. 

除非你能用C语言构建跳转表,否则我敢肯定你不能在内联汇编中使用跳转表。

不幸的是,asm只是实际汇编的一个子集。您不能使用数据指令,正如您所注意到的,emit只执行一个字节

从Microsoft的文档:

Although an __asm block can reference C or C++ data types and objects, it
cannot define data objects with MASM directives or operators. Specifically,
you cannot use the definition directives DB, DW, DD, DQ, DT, and DF, or the
operators DUP or THIS. 
除非你能用C语言构建跳转表,否则我敢肯定你不能在内联汇编中使用跳转表