İşlemci seri nosunu alan kod?

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
fduman
Moderator
Mesajlar: 2749
Kayıt: 17 Ara 2004 12:02
Konum: Ankara

Mesaj gönderen fduman »

IntToStr
stnonstop
Üye
Mesajlar: 149
Kayıt: 22 Haz 2005 04:34

Mesaj gönderen stnonstop »

İşlemcimin seri numarası 1(bir) olamaz değil :D
stnonstop
Üye
Mesajlar: 149
Kayıt: 22 Haz 2005 04:34

Mesaj gönderen stnonstop »

Malesef bir türlü beceremedim sanırsam var bende bir sorun. FloatToStr olmuyor. IntToStr dediğim zaman ise sadece bir değerini geri döndürüyor.
Yazdığım kod


Kod: Tümünü seç

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

DWORD CPUID(void)
{
  DWORD xReturn;
  asm
  {
        PUSH    EBX
        PUSH    EDI
        MOV     EAX,1
        DW      0xA20F
        MOV xReturn, EDX
        POP     EDI
        POP     EBX
  }
  return xReturn;
}
void __fastcall TForm1::FormCreate(TObject *Sender)
{
 ShowMessage(IntToStr(CPUID));
 Edit1->Text = IntToStr(CPUID);
}

PROGRAMADOR
Üye
Mesajlar: 239
Kayıt: 04 Oca 2008 01:53
Konum: Karşıyaka/İzmir

Mesaj gönderen PROGRAMADOR »

Kod: Tümünü seç

#include <iostream>

using namespace std;
int main()
{
	int a;
	__asm{
		push	eax
		push	ebx
		push	ecx
		push	edx
		mov		eax,0
		cpuid
		mov		a,eax
		pop		edx
		pop		ecx
		pop		ebx
		pop		eax
	}
	cout<<a<<endl;
	return 0;
}
Konu eski ama yanıt vereyim dedim. belki arayan olur.
Cevapla