portsh.inc 938 B

1234567891011121314151617181920212223242526272829
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2020 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 : byte;data : byte);inline;
  15. function readport(p : byte) : byte;inline;
  16. public
  17. property pp[p : byte] : byte read readport write writeport;default;
  18. end;
  19. var
  20. { we don't need to initialize port, because neither member
  21. variables nor virtual methods are accessed }
  22. port : tport;
  23. portb : tport absolute port;