home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- * filename - outport.cas
- *
- * function(s)
- * outport - output to a hardware port
- * outportb - output to a hardware port
- *-----------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987,1988,1990 by Borland International |*/
- /*| All Rights Reserved. |*/
- /*| |*/
- /*[]------------------------------------------------------------[]*/
-
- #pragma inline
- #include <dos.h>
-
- #undef outportb
-
- /*-----------------------------------------------------------------------*
-
- Name outport - output to a hardware port
-
- Usage void outport(int port, int val);
-
- Prototype in dos.h
-
- Description see inport
-
- *------------------------------------------------------------------------*/
- void outport(int port, int val)
- {
- asm mov dx, port
- asm mov ax, val
- asm out dx, ax
- }
-
- /*-----------------------------------------------------------------------*
-
- Name outportb - output to a hardware port
-
- Usage #include <dos.h>
- void outportb(int port, unsigned char val);
-
- Prototype in dos.h
-
- Description see inport
-
- *------------------------------------------------------------------------*/
- void outportb(int port, unsigned char val)
- {
- asm mov dx, port
- asm mov al, val
- asm out dx, al
- }
-