portsh.inc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. tport = object
  14. private
  15. procedure writeport(p : word;data : byte);inline;
  16. function readport(p : word) : byte;inline;
  17. public
  18. property pp[w : word] : byte read readport write writeport;default;
  19. end;
  20. tportw = object
  21. private
  22. procedure writeport(p : word;data : word);inline;
  23. function readport(p : word) : word;inline;
  24. public
  25. property pp[w : word] : word read readport write writeport;default;
  26. end;
  27. tportl = object
  28. private
  29. procedure writeport(p : word;data : longint);inline;
  30. function readport(p : word) : longint;inline;
  31. public
  32. property pp[w : word] : longint read readport write writeport;default;
  33. end;
  34. var
  35. { we don't need to initialize port, because neither member
  36. variables nor virtual methods are accessed }
  37. port,
  38. portb : tport;
  39. portw : tportw;
  40. portl : tportl;