Retro Rocket OS
BASIC-Powered Operating System
Loading...
Searching...
No Matches
LGETLASTCPUID Function
LGETLASTCPUID(integer-expression)

Returns the result of the most recent legacy CPUID query, previously initiated by LCPUID.

The single parameter is an index selecting which register value to return, as documented on the CPUID function page:

Value Register
0 EAX
1 EBX
2 ECX
3 EDX

Examples

REM Run CPUID leaf 1, subleaf 0
dummy = LCPUID(&1, 0)
REM Retrieve the EAX result
eax = LGETLASTCPUID(0)
PRINT "EAX = "; eax
REM Print all four registers from a legacy query
dummy = LCPUID(&1, 0)
FOR r = 0 TO 3
PRINT "Reg("; r; ") = "; LGETLASTCPUID(r)
NEXT

Notes

  • Returns a 32-bit register value as an integer.
  • Only valid after a preceding call to LCPUID; otherwise the results are undefined.
  • Passing an index outside 0–3 raises an error.
  • Provided for compatibility with older programs that used legacy CPUID access. New code should use CPUID directly.

See also: LCPUID · CPUID