;       SCCSID = @(#)ghsfar.asm	6.1 90/11/18
;      SCCSID = @(#)ghsfar.asm	  13.2 90/01/25
;***	GHSFAR.ASM - far wrapper for GHS
;
.286

ifdef MEDIUM_MODEL
.model medium, pascal
else
.model small, pascal
endif

ifdef MEDIUM_MODEL
.CODE	_TEXT
else
.CODE
endif

ifdef MEDIUM_MODEL
extrn	GHS:far
else
extrn	GHS:near
endif

;**	GHSFar - far wrapper for GHS
;
;	The purpose of this routine is to minimize stack space.  Since we
;	have only parameter (16 bits), it is easy to reference it and push it
;	on the stack for the call to GHS.  This way we don't use up stack with
;	BP.
;
;	ENTRY	(ss:sp)    -> far return address
;			      Same parameter as GHS
;		(ss:sp+4)  -> USHORT ucch;
;
;	EXIT	(dx:ax) = pointer to heap area
;		    NULL if error
;
;	USES	bx

GHSFar	PROC	FAR

	mov	bx,sp
	push	ss:[bx+4]		; push arg on top of stack

	call	GHS			; call real GHS

	retf	2

GHSFar	endp

	end
