function GetCpuId:longint;assembler;register; var temp:longint; begin asm PUSH EBX PUSH EDI MOV EDI,EAX MOV EAX,1 DW $A20F MOV TEMP,EDX POP EDI POP EBX end; result:=temp; end; //调用: procedure TForm1.Button1Click(Sender: TObject); begin showmessage(inttostr(GetCpuId)); end;