This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call requests or releases access to ports for I/O privilege.
DosPortAccess (Reserved, TypeOfAccess, FirstPort, LastPort)
rc (USHORT) - return:Return code descriptions are:
Note that CLI/STI privilege is also granted automatically. There is no need to make an additional call to DosCLIAccess.
Applications that perform I/O to port(s) in IOPL segments must request port access from the operating system.
An application with no IOPL segments that accesses a device through a device driver or by an interface package such as VIO, does not need to issue this call. The device driver or interface package is responsible for obtaining the necessary I/O access.
#define INCL_DOSDEVICES USHORT rc = DosPortAccess(Reserved, TypeOfAccess, FirstPort, LastPort); USHORT 0; /* 0 */ USHORT TypeOfAccess; /* Request or release */ USHORT FirstPort; /* First port number */ USHORT LastPort; /* Last port number */ USHORT rc; /* return code */
EXTRN DosPortAccess:FAR INCL_DOSDEVICES EQU 1 PUSH WORD 0 ;Reserved (must be zero) PUSH WORD TypeOfAccess ;Request or release PUSH WORD FirstPort ;First port number PUSH WORD LastPort ;Last port number CALL DosPortAccess Returns WORD