system.pp 906 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. unit system;
  2. {$ASMMODE intel}
  3. interface
  4. {$ifdef FULL_RTL}
  5. {$I systemh.inc}
  6. {$endif FULL_RTL}
  7. const
  8. maxExitCode = 255;
  9. {$ifndef FULL_RTL}
  10. type
  11. DWord = LongWord;
  12. Cardinal = LongWord;
  13. Integer = SmallInt;
  14. UInt64 = QWord;
  15. HRESULT = LongInt;
  16. {$endif FULL_RTL}
  17. procedure DebugWrite(const S: string);
  18. procedure DebugWriteLn(const S: string);
  19. implementation
  20. {$ifdef FULL_RTL}
  21. {$I system.inc}
  22. {$endif FULL_RTL}
  23. procedure fpc_Initialize_Units;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
  24. begin
  25. end;
  26. procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
  27. begin
  28. asm
  29. mov ax, 4c00h
  30. int 21h
  31. end;
  32. end;
  33. procedure DebugWrite(const S: string);
  34. begin
  35. asm
  36. mov si, S
  37. lodsb
  38. mov cl, al
  39. xor ch, ch
  40. mov ah, 2
  41. @@1:
  42. lodsb
  43. mov dl, al
  44. int 21h
  45. loop @@1
  46. end;
  47. end;
  48. procedure DebugWriteLn(const S: string);
  49. begin
  50. DebugWrite(S);
  51. DebugWrite(#13#10);
  52. end;
  53. end.