portsh.inc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {
  2. This file is part of the Free Pascal run time library.
  3. and implements some stuff for protected mode programming
  4. Copyright (c) 1999-2000 by the Free Pascal development team.
  5. These files adds support for TP styled port accesses
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. type
  13. {$ifdef VER3_0}
  14. tport = object
  15. procedure writeport(p : word;data : byte);stdcall;
  16. function readport(p : word) : byte;stdcall;
  17. property pp[w : word] : byte read readport write writeport;default;
  18. end;
  19. tportw = object
  20. procedure writeport(p : word;data : word);stdcall;
  21. function readport(p : word) : word;stdcall;
  22. property pp[w : word] : word read readport write writeport;default;
  23. end;
  24. tportl = object
  25. procedure writeport(p : word;data : longint);stdcall;
  26. function readport(p : word) : longint;stdcall;
  27. property pp[w : word] : longint read readport write writeport;default;
  28. end;
  29. {$else VER3_0}
  30. tport = object
  31. private
  32. procedure writeport(p : word;data : byte);inline;
  33. function readport(p : word) : byte;inline;
  34. public
  35. property pp[w : word] : byte read readport write writeport;default;
  36. end;
  37. tportw = object
  38. private
  39. procedure writeport(p : word;data : word);inline;
  40. function readport(p : word) : word;inline;
  41. public
  42. property pp[w : word] : word read readport write writeport;default;
  43. end;
  44. tportl = object
  45. private
  46. procedure writeport(p : word;data : longint);inline;
  47. function readport(p : word) : longint;inline;
  48. public
  49. property pp[w : word] : longint read readport write writeport;default;
  50. end;
  51. {$endif VER3_0}
  52. var
  53. { we don't need to initialize port, because neither member
  54. variables nor virtual methods are accessed }
  55. port,
  56. portb : tport;
  57. portw : tportw;
  58. portl : tportl;