.TITLE ASTX AST Service Exit .IDENT "V1.4" .ENABL LC .PSECT C$CODE ;+ ; Index ASTX AST Service Exit ; ; Usage ; ; #include ; word n; /* # words of trap-dep. param's for AST */ ; ; astx(n); /* AST exit, cut n WORDS off stack */ ; ; ; Description ; ; This "function" effects exit from a C AST service routine. ; It MUST be called to exit from such a routine; a "return" ; will fail owing to the unusual stack structure which has ; R0 and R1 saved in a magic location and may have trap-dependent ; parameters there as well. See the documentation on C AST ; service routine usage in the CX manual for more info. Also ; see the documentation on astset(). ; ; If the particular type of AST starts with trap-dependent ; parameters on the stack, astx MUST be directed to remove them ; prior to doing the actual AST service exit. See the RSX-11M ; V4.0 Executive Reference Manual, sections 2.3.3 and 2.3.4. ; Call with a 0 if there are none. ; ; Notes ; ; Failure of AST exit causes task abort. ; ; Bugs ; ; Does unnecessary thrashing if no TDPs are to be stripped. ;- ; Edits: ; V1.0 10-May-80 RBD Initial edit ; V1.1 30-Jun-80 RBD Change for new DECUS C calling sequence. ; V1.2 09-Feb-82 RBD Changes for saved R0 & R1 under stackframe. ; V1.3 03-May-82 RBD Remove reference to .ABORT ; V1.4 19-Oct-82 RBD Change P-Section name. Fix documentation. ; .mcall astx$s astx:: mov 2(sp),r2 ;# trap dependent parameters asl r2 ;Distance to shuffle down (bytes) mov r5,r1 add #6,r1 ;r1 --> cell below saved r1 add r1,r2 ;r2 --> cell below bottom TDP mov #6,r3 ;Stackframe is 6 words 10$: mov -(r1),-(r2) ;Shuffle down the stackframe sob r3,10$ mov r2,sp ;sp --> saved r2 mov (sp)+,r2 ;Restore the registers mov (sp)+,r3 mov (sp)+,r4 mov (sp)+,r5 mov (sp)+,r0 mov (sp)+,r1 astx$s ;Service exit (whew) bpt ;(oops) Kill task ;03 .end