.TITLE SRDA .IDENT /01/ .PSECT .PROG. .ENABL LC ; ; RSX-11 C Library ; Executive interface ; ; P. Hays 7 February 79 ; ; Specify a receive data ast handler. ; int srda(recast) ; int(*recast)(); ; ; The value in the argument is NULL or the address of a high-level ; ast handler function; this is stored in the static location userf ; for use by the receive data ast assist routine which is included ; within this module. ; ; The return value of function srda is 0 if the directive is accepted ; by the exec, or is the value of the directive status word if rejected. ; .mcall srda$s, astx$s userf: .word 0 ; NULL or address of high-level ast handler srda:: clr r0 ; Clear for "accepted" return value. mov 2(sp),userf ; Store the argument; NULL or function address beq 3$ ; If NULL, go turn off data asts -> srda$s #rdast ; Specify local assist routine ast handler. bcc 9$ ; Directive accepted -> br 7$ ; Directive rejected -> 3$: srda$s ; Turn off receive data asts. bcc 9$ ; Directive accepted -> 7$: mov $dsw,r0 ; If rejected, return DSW. 9$: return ; Return to calling function. rdast: ; Here at ast: call the high-level handler. mov r0,-(sp) ; Save registers not protected by _save mov r1,-(sp) call @userf ; Call the user's handler function. mov (sp)+,r1 ; Restore regs. mov (sp)+,r0 astx$s ; Back to interrupted code via the exec. .end