home *** CD-ROM | disk | FTP | other *** search
- .
- .
- .
- ; attempt to "open" EMM...
- mov dx,seg emm_name ; DS:DX = address of name
- mov ds,dx ; of EMM
- mov dx,offset emm_name
- mov ax,3d00h ; Fxn 3DH, Mode = 00H
- ; = open, read-only
- int 21h ; transfer to MS-DOS
- jc error ; jump if open failed
-
- ; open succeeded, make sure
- ; it was not a file...
- mov bx,ax ; BX = handle from open
- mov ax,4400h ; Fxn 44H Subfxn 00H
- ; = IOCTL Get Device Information
- int 21h ; transfer to MS-DOS
- jc error ; jump if IOCTL call failed
- and dx,80h ; Bit 7 = 1 if character device
- jz error ; jump if it was a file
-
- ; EMM is present, make sure
- ; it is available...
- ; (BX still contains handle)
- mov ax,4407h ; Fxn 44H Subfxn 07H
- ; = IOCTL Get Output Status
- int 21h ; transfer to MS-DOS
- jc error ; jump if IOCTL call failed
- or al,al ; test device status
- jz error ; if AL = 0 EMM is not available
-
- ; now close handle ...
- ; (BX still contains handle)
- mov ah,3eh ; Fxn 3EH = Close
- int 21h ; transfer to MS-DOS
- jc error ; jump if close failed
- .
- .
- .
-
- emm_name db 'EMMXXXX0',0 ; guaranteed device name for EMM
-