system.pp 3.3 KB

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