;       SCCSID = @(#)d_gethgs.asm	6.1 91/02/15
;	SCCSID = @(#)d_gethgs.asm	6.2 90/01/22
; ****************************************************************************
; *									     *
; *			  IBM/Microsoft Confidential			     *
; *									     *
; *		    Copyright (c) IBM Corporation  1987, 1990		     *
; *		    Copyright (c) Microsoft Corp.  1987, 1990		     *
; *			      All Rights Reserved			     *
; *									     *
; ****************************************************************************
;***  d_gethgs.asm - API stub routine DosGetHugeShift
;
;	Member of API library
;	Bill Mershon
;	Copyright MicroSoft Corporation, 1986
;	20-Apr-1986
;
;	library routine for API simulator
;
;	Called from dos 2.x,3.x compatible dos 5.x applications
;
;	Special Information
;		none
;
;	Modification History
;

INCLUDE dos2equ.inc

SHIFT_AMOUNT	EQU	12	; amount to shift to get number of paragraphs
				; (4096) in one segment

;***	DOSGETHUGESHIFT - stub to emulate DOSGETHUGESHIFT function call
;
;	simulates DOS 5.0 call from DOS 2.x,3.x environment
;
;	errorcode = unsigned far pascal
;	DosGetHugeShift(ptr_ShiftCount)
;
;	ENTRY:
;		ptr_ShiftCount - pointer to shift count (for return)
;
;	RETURN:
;		AX = 0 (no error possible)
;
;	EXIT:
;		ptr_ShiftCount contains shift amount for next segment
;		(see DOS 5.0 specification)
;
;	USES:
;		AX
;
;	Pseudo Code:
;		save registers
;		use BP as pointer to stack parameters
;		store return value
;		restore registers
;		return
;
;	WARNING:
;		none
;
;	EFFECTS:
;		none
;

	title	DOSGETHUGESHIFT - stub to emulate DOSGETHUGESHIFT function call
;
;	EXTRN	DOSGETHUGESHIFT:FAR
;
;	PUSH	@ WORD ptr_ShiftCount
;	CALL	DOSGETHUGESHIFT
;

_TEXT	segment byte public 'CODE'

	assume	CS:_TEXT,DS:NOTHING

	public	DOSGETHUGESHIFT

ptr_ShiftCount	equ	[BP+6]

DOSGETHUGESHIFT	proc	far
	push	bp
	mov	bp,sp
	push	ds

	lds	bp,[ptr_ShiftCount]	; DS:BP <- pointer to addr of ret
	mov	ds:[bp], word ptr SHIFT_AMOUNT	; store shift amount

	xor	ax,ax
	pop	ds
	pop	bp
	ret	4	; clear stack of entry parameters (bytes)
DOSGETHUGESHIFT	endp

_TEXT	ends

	end
