gpt4 book ai didi

c++ - __asm__ 在 C++ 错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:02:29 26 4
gpt4 key购买 nike

<分区>

我正在尝试使用以下 cod 读取 cpuid 信息,但它不起作用。我正在使用 Visual Studio 2010:

#include "stdafx.h"
#include <stdio.h>

int main()
{
int a, b;

for (a = 0; a < 5; a++)
{
__asm__("cpuid"
:"=a"(b) // EAX into b (output)
:"0"(a) // a into EAX (input)
:"%ebx","%ecx","%edx"); // clobbered registers

printf("The code %i gives %i\n", a, b);
}

return 0;
}

是这样说的:

'project_scs.exe': Loaded 'C:\Users\rares992\Documents\Visual Studio 2010\Projects\project_scs\Debug\project_scs.exe', Symbols loaded.
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Symbols loaded (source information stripped).
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Symbols loaded (source information stripped).
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Symbols loaded (source information stripped).
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The thread 'Win32 Thread' (0x2190) has exited with code -1073741510 (0xc000013a).
The program '[8828] project_scs.exe: Native' has exited with code -1073741510 (0xc000013a).

谁能告诉我如何让它运行?谢谢

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com