system.pp 649 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. unit system;
  2. {$ASMMODE intel}
  3. interface
  4. type
  5. HRESULT = LongInt;
  6. procedure DebugWrite(const S: string);
  7. procedure DebugWriteLn(const S: string);
  8. implementation
  9. procedure fpc_Initialize_Units;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
  10. begin
  11. end;
  12. procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
  13. begin
  14. asm
  15. mov ax, 4c00h
  16. int 21h
  17. end;
  18. end;
  19. procedure DebugWrite(const S: string);
  20. begin
  21. asm
  22. mov si, S
  23. lodsb
  24. mov cl, al
  25. xor ch, ch
  26. mov ah, 2
  27. @@1:
  28. lodsb
  29. mov dl, al
  30. int 21h
  31. loop @@1
  32. end;
  33. end;
  34. procedure DebugWriteLn(const S: string);
  35. begin
  36. DebugWrite(S);
  37. DebugWrite(#13#10);
  38. end;
  39. end.