portsh.inc 1.4 KB

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