1 TITLE Assembler helper routines for FLUSH13
6 memS EQU
1 ; Small model
7 ?PLM
= 0 ; Standard 'C'
12 ;extern int IOCTLOpen(char *);
13 ;extern int IOCTLWrite(int,char *,int);
14 ;extern int IOCTLRead(int,status *,int);
15 ;extern int IOCTLClose(int);
22 ;** IOCTLOpen - Open the indicated device and make sure it's a device
25 ; Pointer to name of device
27 ; AX = -1 if error, device not opened
28 ; else AX = handle of open device
32 cProc IOCTLOpen
, <PUBLIC>, <si,di,es>
39 INT 21H
; Open the device
40 JC NO_DEV_ERR
; No device
43 INT 21H
; Make sure it IS a device
47 mov ax,bx ; Return the handle
58 ;** IOCTLClose - Close the indicated handle
67 cProc IOCTLClose
, <PUBLIC>, <si,di,es>
74 INT 21H
; close the device
77 ;** IOCTLWrite - Perform IOCTLWrite to device handle
80 ; Handle to open device
81 ; Pointer to data to write
82 ; Count in bytes of data to write
85 ; else AX = input count
89 cProc IOCTLWrite
, <PUBLIC>, <si,di,es>
99 MOV AX,4403H
; IOCTL Write
111 ;** IOCTLRead - Perform IOCTLRead to device handle
114 ; Handle to open device
115 ; Pointer to data area to read into
116 ; Count in bytes of size of data area
119 ; else AX = input count
123 cProc IOCTLRead
, <PUBLIC>, <si,di,es>
133 MOV AX,4402H
; IOCTL Read