简体   繁体   English

C2400内联汇编器语法错误,与2015年相比

[英]C2400 inline assembler syntax error, vs 2015

__asm {
                xor eax, eax 
                cpuid 
                mov vendor_id, ebx
                mov vendor_id + 4, edx
                mov vendor_id + 8, ecx
                mov eax, 1 
                cupid 
                mov reg_eax, eax <--this line
                mov reg_edx, edx 
            }

It shows Error C2400 inline assembler syntax error in 'opcode'; 它显示“ opcode”中的错误C2400内联汇编器语法错误; found 'newline' 找到“换行符”

and

if (Is_HT_Supported())
        {   __asm { 
            mov eax, 1
            cpuid mov reg_ebx, ebx <-- this line
            }
            return (unsigned char)((reg_ebx & NUM_LOGICAL_BITS) >> 16);
        }
        else
        {
            return (unsigned char)1;
        }

Shows Error C2400 inline assembler syntax error in 'first operand'; 在“第一个操作数”中显示错误C2400内联汇编器语法错误; found ',' 找到“,”

How to fix it? 如何解决? I'm using VS 2015 我正在使用VS 2015

I had the same problem with the same part of code. 我在同一部分代码中遇到了同样的问题。 And changing cupid to cpuid in 然后将cupid更改为cpuid

cupid 
mov reg_eax, eax <--this line

solved this 解决了这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM