;       SCCSID = @(#)realopen.asm	6.1 90/11/16
;	SCCSID = @(#)realopen.asm	6.1 89/02/16
;/******************** START OF SPECIFICATIONS ************************/
;/*								      */
;/* SOURCE FILE NAME: REALOPEN.ASM				      */
;/*								      */
;/* DESCRIPTIVE NAME: OPEN DRIVE IN REAL MODE			      */
;/*								      */
;/* FUNCTION:							      */
;/*								      */
;/*	Open drive in real mode					      */
;/*								      */
;/* NOTES:							      */
;/*								      */
;/* ENTRY POINTS:  realopen					      */
;/*								      */
;/* INPUT:							      */
;/*	      4 bytes - address of drive name			      */
;/*	      4 bytes - address of drive handle			      */
;/*	      2 bytes - open mode				      */
;/*								      */
;/* EXIT-NORMAL:						      */
;/*   RETURN CODE SYMBOL:					      */
;/*								      */
;/* EXIT-ERROR:							      */
;/*   RETURN CODE SYMBOL:					      */
;/*								      */
;/* EXTERNAL REFERENCE:	 none					      */
;/*								      */
;/* RELEASE:							      */
;/*								      */
;/*   VERSION	     DATE		REASON			      */
;/*								      */
;/*	1.00	  08/07/1986	  initial version		      */
;/*	1.01	  10/16/1986	  change ini 21h mode 63h to 64h      */
;/*								      */
;/*******************8*************************************************/
_TEXT	segment PARA	public 'CODE'
	assume	cs:_TEXT,ds:nothing,es:nothing, ss:nothing
	public	REALOPEN

REALOPEN  proc	  far
	push	bp
	mov	bp,sp
	push	ds
	push	bx
	push	cx
	push	dx

	mov	ah,64h
	mov	cx,[bp+6]			; open mode
	lds	dx,[bp+12]			; ds:dx->drive name
	int	21h
	jc	drv_err
	lds	bx,[bp+8]			; device handle addr
	mov	ds:[bx],ax			; save device handle
	xor	ax,ax				; ax = good return code

drv_err:
	pop	dx
	pop	cx
	pop	bx
	pop	ds
	pop	bp

	ret	10
REALOPEN endp

_TEXT	ends
	end
