system.pp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Florian Klaempfl
  4. member of the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$define PALMOS}
  12. {$ASMMODE DIRECT}
  13. unit system;
  14. {$I os.inc}
  15. Interface
  16. {Platform specific information}
  17. const
  18. LineEnding = #10;
  19. LFNSupport = false;
  20. DirectorySeparator = '/';
  21. DriveSeparator = ':';
  22. PathSeparator = ';';
  23. FileNameCaseSensitive = false;
  24. CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
  25. maxExitCode = 255; {$ERROR TODO: CONFIRM THIS}
  26. MaxPathLen = 256;
  27. Type
  28. { type and constant declartions doesn't hurt }
  29. LongInt = $80000000..$7fffffff;
  30. Integer = -32768..32767;
  31. ShortInt = -128..127;
  32. Byte = 0..255;
  33. Word = 0..65535;
  34. { !!!!
  35. DWord = Cardinal;
  36. LongWord = Cardinal;
  37. }
  38. { The Cardinal data type isn't currently implemented for the m68k }
  39. DWord = LongInt;
  40. LongWord = LongInt;
  41. { Zero - terminated strings }
  42. PChar = ^Char;
  43. PPChar = ^PChar;
  44. { procedure type }
  45. TProcedure = Procedure;
  46. const
  47. { max. values for longint and int }
  48. MaxLongint = High(LongInt);
  49. MaxInt = High(Integer);
  50. { Must be determined at startup for both }
  51. Test68000 : byte = 0;
  52. Test68881 : byte = 0;
  53. { Palm specific data types }
  54. type
  55. Ptr = ^Char;
  56. var
  57. ExitCode : DWord;
  58. { this variables are passed to PilotMain by the PalmOS }
  59. cmd : Word;
  60. cmdPBP : Ptr;
  61. launchFlags : Word;
  62. implementation
  63. { mimic the C start code }
  64. function PilotMain(_cmd : Word;_cmdPBP : Ptr;_launchFlags : Word) : DWord;cdecl;public;
  65. begin
  66. cmd:=_cmd;
  67. cmdPBP:=_cmdPBP;
  68. launchFlags:=_launchFlags;
  69. asm
  70. bsr PASCALMAIN
  71. end;
  72. PilotMain:=ExitCode;
  73. end;
  74. {*****************************************************************************
  75. System Dependent Exit code
  76. *****************************************************************************}
  77. Procedure system_exit;
  78. begin
  79. end;
  80. function GetProcessID: SizeUInt;
  81. begin
  82. GetProcessID := 1;
  83. end;
  84. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  85. begin
  86. result := stklen;
  87. end;
  88. begin
  89. StackLength := CheckInitialStkLen (InitialStkLen);
  90. ExitCode:=0;
  91. end.