Here is the cpuid component o2 modification:
1 plings removed from asm instructions
2 ebx register must be preserved, then restored after cpuid execution
3 hiwrd/lowrd redundant
NB CPU serial numbers are not properly implemented after PentiumIII, due to privacy concerns.
def hiwrd hiword
def lowrd loword
'===============================================================
' GetCpuSerial - Returns serial no on Intel CPU
' http://www.garybeene.com/powerbasic/thread_014065.htm
' However it is not in the same format as those obtained by C#
FUNCTION GetCpuSerial() AS STRING
LOCAL t AS DWORD, m AS DWORD, b AS DWORD
local sys mrbx=rbx 'save rbx for global refs
mov eax,1
cpuid
mov t,eax
mov eax,3
cpuid
mov m,edx
mov b,ecx
mov rbx,mrbx 'restore rbx for lobal refs
function=hex$(t,8) & hex$(m,8) & hex$(b,8)
'FUNCTION = HEX$(HIWRD(t),4) & HEX$(LOWRD(t),4) & HEX$(HIWRD(m),4) & _
'HEX$(LOWRD(m),4) & HEX$(HIWRD(b),4) & HEX$(LOWRD(b),4)
END FUNCTION
print GetCpuSerial