mtinf.pas 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {
  2. Copyright (c) 2021 Karoly Balogh and Norman Dunbar
  3. System info/System variables access on a Sinclair QL, QDOS 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 mtinf;
  9. uses
  10. qdos;
  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:=mt_inf(@system_vars,@ver_ascii);
  30. writeln('Job ID:',lo(job_id),' Tag:',hi(job_id));
  31. writeln('Identification: ',get_id_str(system_vars^.SV_IDENT));
  32. writeln('Version: ',Tver(ver_ascii));
  33. writeln('System vars are at: $',hexstr(system_vars));
  34. writeln('Processor type: 680',hexstr(system_vars^.SV_PTYP,2));
  35. writeln('Monitor mode: ',system_vars^.SV_TVMOD);
  36. writeln('Random number: ',system_vars^.SV_RAND);
  37. end.