portsh.inc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Michael Van Canneyt
  4. member of the Free Pascal development team
  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. { Implements the
  12. port[] portw[] and portl[]
  13. constructs using objects }
  14. type
  15. tport = object
  16. private
  17. procedure writeport(p : longint;data : byte);inline;
  18. function readport(p : longint) : byte;inline;
  19. public
  20. property pp[w : longint] : byte read readport write writeport;default;
  21. end;
  22. tportw = object
  23. private
  24. procedure writeport(p : longint;data : word);inline;
  25. function readport(p : longint) : word;inline;
  26. public
  27. property pp[w : longint] : word read readport write writeport;default;
  28. end;
  29. tportl = object
  30. Private
  31. procedure writeport(p : longint;data : longint);inline;
  32. function readport(p : longint) : longint;inline;
  33. Public
  34. property pp[w : Longint] : longint read readport write writeport;default;
  35. end;
  36. { Non-Instantiaded vars. As yet, they don't have to be instantiated,
  37. because there is no need for 'self' etc. }
  38. var
  39. port,
  40. portb : tport;
  41. portw : tportw;
  42. portl : tportl;