	.TITLE	RQST
	.IDENT	/02/
	.PSECT	.PROG.
	.ENABLE	LC
;
; P. Hays		24 May 79
; D. Conroy		 4 October 79
;
; Request activation of an installed task.
; int rqst(taskname, group, member)
; char *taskname; int group,member;
;
; The return value of the function is normally 0; if the directive
; is rejected, the value of the directive status word is returned.
;
	.mcall dir$

; Offsets re stackframe for the input parameters:
a.mem = 16			; UIC member code
a.grp = 14			; UIC group code
a.targ = 12			; Address of target task's name string

rqst::
	jsr	r0,$$csav	; Linkage
	sub	#14.,sp		; Claim stack space for the dpb
	mov	sp, r2		; r2 <- address of DPB

	mov	(pc)+,(r2)	; Store 1st word of rqst$ DPB:
	.byte	11.,7		; Dic 11, dpb size 7 words.

	; Convert taskname to rad50 for the exec call
	mov	a.targ(r5), -(sp); Push address of user's string
	mov	#2, -(sp)	; Specify conversion of 2 words
	mov	r2, -(sp)	; Push address of taskname field in DPB
	add	#2, (sp)
	call	ator		; (from lb:[1,1]clib.olb)
	mov	r2, sp		; Pop args

	clr	6(r2)		; Clear partition, priority; ignored.
	clr	10(r2)
	clr	12(r2)

	movb	a.mem(r5),14(r2); UIC member code
	movb	a.grp(r5),15(r2); UIC group code

	clr	r0		; Prepare to return NULL if directive accepted.
	dir$			; Call the exec.
	bcc	9$		;	Directive accepted	->

	mov	@#$dsw,r0	; If directive rejected, return dsw.
9$:
	jmp	$$cret		; Done

.end
