sms_info.pas 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {
  2. Copyright (c) 2021 Karoly Balogh and Norman Dunbar
  3. System info/System variables access on a Sinclair QL, SMS naming
  4. Example program for Free Pascal's Sinclair QL support
  5. This example program is in the Public Domain under the terms of
  6. Unlicense: http://unlicense.org/
  7. **********************************************************************}
  8. program sms_info;
  9. uses
  10. sms;
  11. type
  12. Tver = array[0..3] of AnsiChar;
  13. var
  14. job_id: longint;
  15. ver_ascii: longint;
  16. system_vars: pSystemVariables;
  17. function get_id_str(const id: dword): AnsiString;
  18. begin
  19. case id of
  20. SYSID_QL: get_id_str:='QDOS';
  21. SYSID_AT: get_id_str:='Atari (SMS)';
  22. SYSID_SQ: get_id_str:='SMSQ';
  23. SYSID_TH: get_id_str:='Thor (ARGOS)';
  24. else
  25. get_id_str:='unknown ($'+hexstr(id,8)+')';
  26. end;
  27. end;
  28. begin
  29. job_id:=sms_info(@system_vars,@ver_ascii);
  30. writeln('Job ID:',lo(job_id),' Tag:',hi(job_id));
  31. writeln('Identification: ',get_id_str(system_vars^.SYS_IDNT));
  32. writeln('Version: ',Tver(ver_ascii));
  33. writeln('System vars are at: $',hexstr(system_vars));
  34. writeln('Processor type: 680',hexstr(system_vars^.SYS_PTYP,2));
  35. writeln('Monitor mode: ',system_vars^.SYS_TMOD);
  36. writeln('Random number: ',system_vars^.SYS_RAND);
  37. writeln('Real Time Clock: ',system_vars^.SYS_RTC);
  38. end.