system.pp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. unit system;
  2. {$ASMMODE intel}
  3. interface
  4. {$DEFINE FPC_INCLUDE_SOFTWARE_MUL}
  5. {$DEFINE FPC_INCLUDE_SOFTWARE_MOD_DIV}
  6. {$I systemh.inc}
  7. const
  8. LineEnding = #13#10;
  9. { LFNSupport is a variable here, defined below!!! }
  10. DirectorySeparator = '\';
  11. DriveSeparator = ':';
  12. ExtensionSeparator = '.';
  13. PathSeparator = ';';
  14. AllowDirectorySeparators : set of char = ['\','/'];
  15. AllowDriveSeparators : set of char = [':'];
  16. { FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
  17. maxExitCode = 255;
  18. MaxPathLen = 256;
  19. const
  20. { Default filehandles }
  21. UnusedHandle = -1;
  22. StdInputHandle = 0;
  23. StdOutputHandle = 1;
  24. StdErrorHandle = 2;
  25. FileNameCaseSensitive : boolean = false;
  26. FileNameCasePreserving: boolean = false;
  27. CtrlZMarksEOF: boolean = true; (* #26 is considered as end of file *)
  28. sLineBreak = LineEnding;
  29. DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCRLF;
  30. { Default memory segments (Tp7 compatibility) }
  31. seg0040 = $0040;
  32. segA000 = $A000;
  33. segB000 = $B000;
  34. segB800 = $B800;
  35. var
  36. { C-compatible arguments and environment }
  37. argc:longint; //!! public name 'operatingsystem_parameter_argc';
  38. argv:PPchar; //!! public name 'operatingsystem_parameter_argv';
  39. envp:PPchar; //!! public name 'operatingsystem_parameter_envp';
  40. dos_argv0 : pchar; //!! public name 'dos_argv0';
  41. AllFilesMask: string [3];
  42. {$ifndef RTLLITE}
  43. { System info }
  44. LFNSupport : boolean;
  45. {$ELSE RTLLITE}
  46. const
  47. LFNSupport = false;
  48. {$endif RTLLITE}
  49. procedure DebugWrite(const S: string);
  50. procedure DebugWriteLn(const S: string);
  51. implementation
  52. {$I system.inc}
  53. procedure DebugWrite(const S: string);
  54. begin
  55. asm
  56. mov si, S
  57. lodsb
  58. mov cl, al
  59. xor ch, ch
  60. mov ah, 2
  61. @@1:
  62. lodsb
  63. mov dl, al
  64. int 21h
  65. loop @@1
  66. end ['ax','bx','cx','dx','si','di'];
  67. end;
  68. procedure DebugWriteLn(const S: string);
  69. begin
  70. DebugWrite(S);
  71. DebugWrite(#13#10);
  72. end;
  73. {*****************************************************************************
  74. ParamStr/Randomize
  75. *****************************************************************************}
  76. function paramcount : longint;
  77. begin
  78. paramcount := 0;
  79. end;
  80. function paramstr(l : longint) : string;
  81. begin
  82. paramstr := '';
  83. end;
  84. procedure randomize;
  85. begin
  86. end;
  87. {*****************************************************************************
  88. System Dependent Exit code
  89. *****************************************************************************}
  90. procedure system_exit;
  91. begin
  92. asm
  93. mov al, byte [exitcode]
  94. mov ah, 4Ch
  95. int 21h
  96. end;
  97. end;
  98. {*****************************************************************************
  99. SystemUnit Initialization
  100. *****************************************************************************}
  101. procedure SysInitStdIO;
  102. begin
  103. { OpenStdIO(Input,fmInput,StdInputHandle);
  104. OpenStdIO(Output,fmOutput,StdOutputHandle);
  105. OpenStdIO(ErrOutput,fmOutput,StdErrorHandle);
  106. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  107. OpenStdIO(StdErr,fmOutput,StdErrorHandle);}
  108. end;
  109. function GetProcessID: SizeUInt;
  110. begin
  111. GetProcessID := 1;
  112. end;
  113. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  114. begin
  115. result := stklen;
  116. end;
  117. end.