home *** CD-ROM | disk | FTP | other *** search
- include farnear.inc
-
- _TEXT segment byte public 'CODE'
- assume cs:_TEXT
- mgrname db 'SCSIMGR$',0
-
- program _ASPI_entry ; int ASPI_entry(void far (**)())
- push bp
- mov bp,sp
- push ds
-
- push cs
- pop ds
-
- lea dx,mgrname
- mov ax,3d00h
- int 21h ; open file
- mov cx,-1 ; does not affect flags
- jc short return
-
- push ax ; save the handle
- xchg ax,bx ; mov bx,ax
- mov ax,4400h
- int 21h ; query device info
- jc short error
- test dl,dl ; is it device or file?
- jns short error
-
- pop bx ; restore the handle
- push bx ; put it back again
-
- lds dx,arglist
- mov cx,4
- mov ax,4402h
- int 21h ; read the pointer
- jc short error
- xor cx,cx ; mark success
- jmp short close
- error:
- mov cx,-1 ; mark an error
- close:
- pop bx ; BX := handle
- mov ah,3Eh
- int 21h
- return:
- xchg ax,cx ; mov ax,cx
- pop ds
- pop bp
- ret
- _ASPI_entry endp
- _TEXT ends
- end