.TITLE ASTSET Set AST service environment .IDENT "V1.2" .ENABL LC .PSECT C$CODE ;+ ; Index ASTSET Set AST service environment ; ; Usage ; ; #include ; ; astset(); ; ; Description ; ; This function must be called immediately upon entrance ; to any function which is used as an AST service routine. ; Since AST service is (obviously) asynchronous, ALL registers ; must be preserved across the execution of an AST service ; routine. astset() handles this requirement by saving R0 ; and R1 in a transparent manner by tucking them under the ; normal C stack frame. The astx() function automatically ; restores the original environment prior to issuing the ; AST service exit directive. ; ; This means that a function which is used as an AST service ; routine may NOT be used as a normal function. It must always ; exit with a call to astx()! ; ; For more information on usage of C AST service routines, ; see the section on AST service in the CX manual. ; ; [end] ;- ; Edits: ; V1.1 17-Feb-82 RBD Initial edit and debug ; V1.2 18-Oct-82 RBD Change P-Sections. Fix documentation ; astset:: sub #4,sp ; Make room for shuffled stackframe mov 4(sp),(sp) ; Move up the return address ;01 sub #12,r5 ; Use R5 to shuffle ;01 mov #4,r2 ; Count ;01 10$: mov 4(r5),(r5)+ ; Shuffle sob r2,10$ mov r0,(r5)+ ; Tuck R0 under stackframe mov r1,(r5)+ ; Same with r1 sub #6,r5 ; Reset R5 --> stackframe return .end