;*
;* exec2e - Issue INT 2E (spawn COMMAND.COM) linkage for MSC 4.0
;*
;* Note: CS must be writable for this to work (no 286 in protected mode)

;* Version T1.00 - 30-Mar-87 - tmk - Initial version
;* Version T1.01 - 02-Jul-87 - tmk - Add support for Turbo C
;* Version T1.02 - 14-Jul-87 - tmk - Stick version no. in binary
;* Version T1.03 - 15-Oct-87 - tmk - Remove .287 for MASM 5.0

;* do stuff for C interfaces

	TITLE   exec2e

_TEXT	SEGMENT  BYTE PUBLIC 'CODE'
_TEXT	ENDS
_DATA	SEGMENT  WORD PUBLIC 'DATA'
_DATA	ENDS
CONST	SEGMENT  WORD PUBLIC 'CONST'
CONST	ENDS
_BSS	SEGMENT  WORD PUBLIC 'BSS'
_BSS	ENDS
DGROUP	GROUP	CONST,	_BSS,	_DATA
	ASSUME  CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
;
_TEXT   SEGMENT
	PUBLIC	_exec2e

	db	'EXEC2E T1.03 - 15-Oct-87 - tmk'

_exec2e	PROC NEAR
	push	bp
	mov	bp,sp
	push	ds			;save some registers
	push	bp
	push	si
	push	di
	mov	word ptr cs:spsave,sp	;save SP
	mov	word ptr cs:sssave,ss	;and SS
	mov	si,word ptr[bp+4]
	int	2eh
	mov	sp,word ptr cs:spsave
	mov	ss,word ptr cs:sssave
	pop	di
	pop	si
	pop	bp
	pop	ds
	mov	sp,bp
	pop	bp
	ret	
;
sssave	dw	?			;save area for SS
spsave	dw	?			;save area for SP
;
_exec2e	ENDP
_TEXT	ENDS
	END
