我可以从 __asm 块外部访问 __asm 变量吗?
Can I access __asm variables from outside an __asm block?
我知道 __asm
块可以访问在这些块外声明的变量,但我想做的是找到一种方法来访问 __asm
块中声明的变量从这样一个街区外。我对 C 和 C++ 的所有了解都表明这应该是不可能的,因为 C 和 C++ 在 {}
块中限定任何内容的方式。有没有办法做到这一点,或者我是否需要在 __asm
块之外声明此类变量?
PS:我无法从我的任何搜索中找到此问题的任何相关答案。
答案似乎是否定的
Microsoft Specific
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. MASM structures and records are also unavailable. The inline assembler doesn't accept the directives STRUC, RECORD, WIDTH, or MASK.
END Microsoft Specific
我知道 __asm
块可以访问在这些块外声明的变量,但我想做的是找到一种方法来访问 __asm
块中声明的变量从这样一个街区外。我对 C 和 C++ 的所有了解都表明这应该是不可能的,因为 C 和 C++ 在 {}
块中限定任何内容的方式。有没有办法做到这一点,或者我是否需要在 __asm
块之外声明此类变量?
PS:我无法从我的任何搜索中找到此问题的任何相关答案。
答案似乎是否定的
Microsoft Specific
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. MASM structures and records are also unavailable. The inline assembler doesn't accept the directives STRUC, RECORD, WIDTH, or MASK.
END Microsoft Specific