.title rcvdat ; ; this routine performs a receive data or stop; if the task is stopped ; and then unstopped, it performs a receive data to fetch the message ; which caused it to be unstopped ; call with the following interface ; ; subroutine rcvdat([task], buffer) ; .mcall rcst$s,rcvd$s ap=%5 tsk=2 buf=4 .psect $r.rod,con,ro,rel,lcl,d dumtsk: .word 0,0 ; dummy task name to use if user omits it .psect $r.roi,con,ro,rel,lcl,i .enabl lsb rcvdat:: mov tsk(ap),r1 ; move address of task field into r0 cmp #-1,r1 ; see if user left it blank bne 10$ ; if !=, then user supplied task name mov #dumtsk,r1 ; place null task name address into r0 10$: rcst$s r1,buf(ap) ; receive data or stop cmp $dsw,#is.suc ; received data? beq 20$ ; YES rcvd$s r1,buf(ap) ; get data which unstopped us 20$: mov $dsw,r0 ; return dsw return .end