I was able to compile the following program without errors, however it just exited when run.
It is a program to get CPU speed, it was working well in PowerBasic
could be something to do with QUAD?
$ filename "GetCpuSpeed_64.exe"
use rtl64
use minwin
' This program will obtain the CPU's speed
Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As QUAD) As Long
Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As QUAD) As Long
'=====================================
FUNCTION CpuSpeed() AS STRING
LOCAL Count0 AS QUAD
LOCAL Count1 AS QUAD
LOCAL Count2 AS QUAD
LOCAL Freq AS QUAD
LOCAL NewCount AS QUAD
LOCAL CpuFreq AS DWORD
QueryPerformanceFrequency(Freq)
Freq = Freq \ 10
pushad
db &h0f, &h31
mov Count1[04], edx
mov Count1[00], eax
popad
QueryPerformanceCounter(Count0)
NewCount = Count0 + Freq
WHILE (Count0 < NewCount)
QueryPerformanceCounter(Count0)
WEND
pushad
db &h0f, &h31
mov Count2[04], edx
mov Count2[00], eax
popad
CpuFreq = (Count2 - Count1) \ 100000
IF CpuFreq > 1000 THEN
FUNCTION = str(CpuFreq / 1000 ) + " giga hertz"
ELSE
FUNCTION = str(CpuFreq ) + " mega hertz"
END IF
END FUNCTION
'====================
print CpuSpeed
The Powerbasic equivalent is here
#COMPILE EXE
#DIM ALL
#INCLUDE "Win32API.inc"
'===============================
FUNCTION PBMAIN () AS LONG
LOCAL cpuspd AS STRING
cpuspd = CpuSpeed()
? cpuspd
END FUNCTION
'=============================
FUNCTION CpuSpeed() AS STRING
LOCAL Count0 AS QUAD
LOCAL Count1 AS QUAD
LOCAL Count2 AS QUAD
LOCAL Freq AS QUAD
LOCAL NewCount AS QUAD
LOCAL CpuFreq AS DWORD
QueryPerformanceFrequency(Freq)
Freq = Freq \ 10
ASM pushad
ASM db &h0f, &h31
ASM mov Count1[04], edx
ASM mov Count1[00], eax
ASM popad
QueryPerformanceCounter(Count0)
NewCount = Count0 + Freq
WHILE (Count0 < NewCount)
QueryPerformanceCounter(Count0)
WEND
ASM pushad
ASM db &h0f, &h31
ASM mov Count2[04], edx
ASM mov Count2[00], eax
ASM popad
CpuFreq = (Count2 - Count1) \ 100000
IF CpuFreq > 1000 THEN
FUNCTION = FORMAT$(CpuFreq / 1000, "0.000") & " giga hertz"
ELSE
FUNCTION = FORMAT$(CpuFreq, "0,0") & " mega hertz"
END IF
END FUNCTION