Einzelnen Beitrag anzeigen

Razor
(Gast)

n/a Beiträge
 
#11

Re: C++ 2 Delphi, Core2duo/quad Reading

  Alt 28. Aug 2007, 12:05
Ahh i provided core2duo/core2quad cpu usage and nobody was thankfull,i see people begging for codes to be translated and people just do it?Explain that?

Why you think i am posting in this forum at all?So other users can benefit from this also!




I only need MSR Access code i figured the cpuid and other stuff by myself

EDIT: i found this code on newsgroups

Delphi-Quellcode:
type
{ hier können eigene, bessere Namen definiert werden } 
  TMachineStateRegisterRange = (Bit0 = 0, Bit63 = 63);
  TMachineStateRegister = set of TMachineStateRegisterRange;


function getMsr(whichone: Integer): TMachineStateRegister;
var
  res: TMachineStateRegister;
begin
  asm
    mov ecx, whichone
    rdmsr
    lea esi, res
    mov [esi], ax
    mov [esi+4], dx
  end;
  getMsr := res;
end;


var
  msr: TMachineStateRegister;
  i: TMachineStateRegisterRange;


begin
  msr := getMsr(0);
  for i := Low(TMachineStateRegisterRange) to
           High(TMachineStateRegisterRange) do
    if i in msr then
      WriteLn('Bit ', Ord(i), ' ist gesetzt.');
end.

Found this also

Delphi-Quellcode:
    function ReadMSR(msr_num: DWord; var msr: tmsr): boolean;
    function WriteMSR(msr_num: DWord; const msr: tmsr): boolean;
  Mit Zitat antworten Zitat