ports.inc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. {$asmmode ATT}
  13. { to give easy port access like tp with port[] }
  14. procedure tport.writeport(p : word;data : byte);inline;
  15. begin
  16. fpc_x86_outportb(p,data);
  17. end;
  18. function tport.readport(p : word) : byte;inline;
  19. begin
  20. readport:=fpc_x86_inportb(p);
  21. end;
  22. procedure tportw.writeport(p : word;data : word);inline;
  23. begin
  24. fpc_x86_outportw(p,data);
  25. end;
  26. function tportw.readport(p : word) : word;inline;
  27. begin
  28. readport:=fpc_x86_inportw(p);
  29. end;
  30. procedure tportl.writeport(p : word;data : longint);inline;
  31. begin
  32. fpc_x86_outportl(p,data);
  33. end;
  34. function tportl.readport(p : word) : longint;inline;
  35. begin
  36. readport:=fpc_x86_inportl(p);
  37. end;