system.pp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
  63. begin
  64. asm
  65. mov ax, 4c00h
  66. int 21h
  67. end;
  68. end;
  69. procedure DebugWrite(const S: string);
  70. begin
  71. asm
  72. mov si, S
  73. lodsb
  74. mov cl, al
  75. xor ch, ch
  76. mov ah, 2
  77. @@1:
  78. lodsb
  79. mov dl, al
  80. int 21h
  81. loop @@1
  82. end;
  83. end;
  84. procedure DebugWriteLn(const S: string);
  85. begin
  86. DebugWrite(S);
  87. DebugWrite(#13#10);
  88. end;
  89. end.