Bonjour,
voici un pièce de code que j'ai récupérer du forum pour compléter mon système . tous marche bien à part 2 erreur que j'ai pas résoudre (je mis les emplacement en gras
et__asm
{
pushfd
pop eax // Copy EFLAGS into EAX.
mov ebx,eax // Then make a backup copy in EBX.
xor eax,0x00200000 // Flip bit 21.
push eax
popfd // Copy the modified EAX back to EFLAGS.
pushfd
pop eax // Copy EFLAGS into EAX again.
push ebx
popf // Reset EFLAGS to what it was before all this pushing & popping...
cmp eax, ebx // Compare EAX & EBX to see if bit 21 is still changed.
jz cpuid_not_supported // If the flag wasn't changed, jump to end of this function.
}
j'ai compilé sous c/c++ masm avec les option suivantes ://///////////////////////////////////////////////////////////////////
// cpuid_00h()
/////////////////////////////////////////////////////////////////////
bool
CCPUIDInfo::cpuid_00h()
{
////////////////////////////////////
// Pass 0x00 to cpuid.
// Get the Processor Vendor ID.
char* pszName = m_ProcessorName; // Get a pointer to ProcessorName.
char *exclam ="Valeur maximale reconnue est :";
char data;
char* datap;
unsigned int EAXBuf = 0;
__asm
{
mov eax, 0; // Get Processor Vendor ID.
CPUID ;
mov EAXBuf, eax ; // This holds the highest value we can pass to cpuid.
mov di, pszName ; // Copy Processor Vendor ID into buf.
mov [edi], bx ;
mov [edi+4], dx ;
mov [edi+8], cx ;
}
m_HighestInputValue = AXBuf;
data=(char)m_HighestInputValue ;
datap=&data;
#ifdef _DEBUG
CDisplay::TextOut (exclam ,0,5, BLACK,WHITE,false);
CDisplay::TextOut (datap ,CString::Strlen(exclam),5, BLACK,GREEN,false);
#endif // _DEBUG
pszName[ 12 ] = '\0'; // Terminate the string.
return true;
}
CL.EXE /AT /Ge /Gx /c /Zl
ML.EXE /AT /c
LINK.EXE /T
je rapelle
CL.EXE --> microsoft c/c++ compiler version 8
ML -->masm v8
LINk.EXE --> microsoft incremental linker
je reçois les erreurs suivants :
error c2415 : improper operand type
error c2400 : inline syntax error in 'opcode' ;found newline
quelqu'un à une idée ?
Partager