	Title GetCmd
	page ,132

;-------------------------------------------------------------------------

DATA	SEGMENT	PUBLIC	'DATA'
		DB	'GETCMD  '
SP_SAVE		DW	0
		DD	GETCMD
		DD	0

DATA	ENDS

;-------------------------------------------------------------------------

;	PARAMETER LIST CONTROL BLOCK

FRAME	STRUC

	PARM1	DD	?	;LINE (CHARACTER*80)

FRAME	ENDS
;-------------------------------------------------------------------------


	CMDLNTH	EQU 80H
	CMDLINE	EQU 81H

	EXTRN	F@PSPS:WORD



;-------------------CODE SEGMENT DEFINITION FOR PROFORT-------------------

CODE	SEGMENT	PARA	PUBLIC	'CODE'
	ASSUME	CS:CODE,DS:DATA			;required by RMFORT
	DW	SEG DATA			;required by RMFORT
;-------------------------------------------------------------------------
PUBLIC	GETCMD
GETCMD	PROC	FAR
	ASSUME	CS:CODE			;
	MOV	AX,DATA			;standard preamble, only CS,
	MOV	DS,AX			;SS, and SP must be maintained
	MOV	SP_SAVE,SP		;for PROFORT. Module address is

	LDS	SI,ES:PARM1[BX]		;DS:SI POINTS TO PARM1 DSC BLOCK
	MOV	ES,[SI+4]
	MOV	DI,[SI+2]

	MOV	BX, SEG F@PSPS		; F@PSPS IS PROGRAM PREFIX SEGMENT
	MOV	DS, BX
	MOV	BX, F@PSPS
	MOV	DS, BX

	MOV	SI, CMDLNTH
	MOV	CX, 0
	MOV	CL, [SI]		;CX=LENGTH OF CMD LINE

	MOV	SI, CMDLINE
	CLD
	REP	MOVSB


	RET

GETCMD	ENDP
;-------------------------------------------------------------------------

CODE	ENDS
	END
