如何在C中访问CPU寄存器?

| 我要访问AH寄存器。我已经尝试过了,但是它争论了“ 0”标识符。
register int _AH asm (\"AH\");
平台:Intel CPU x86,Windows 7 尝试使用Visual Studio 2010(cl.exe)进行编译     
已邀请:
我在项目中使用了以下内容:
unsigned char foo;

__asm {
   mov foo, ah
}
您在这里有更多信息:http://msdn.microsoft.com/zh-cn/library/fabdxz08.aspx 希望能帮助到你。     
您需要指定使用的平台和编译器。 还应注意,从C源代码生成的代码当然也将使用CPU的寄存器。     
在Visual Studio中,asm语法为
__asm assembly-instruction [ ; ]

__asm { assembly-instruction-list } [ ; ]
如此处所述http://msdn.microsoft.com/en-us/library/4ks26t93.aspx     

要回复问题请先登录注册