.TITLE GTDP Get Trap-Dependent Parameter .IDENT "V1.3" .ENABL LC .PSECT C$CODE ;+ ; Index GTDP Get Trap Dependent Parameter ; ; Usage ; ; #include ; word woff; /* WORD offset to TDP */ ; word tdp; /* Ret. Trap-Dep. Parameter */ ; ; tdp = gtdp(woff); ; ; Description ; ; This routine is not an executive services call. It ; is the mechanism by which an AST service routine may ; access the interrupted task's state or trap ; dependent parameters pushed on to the stack when the ; AST occured. The appropriate Executive Reference ; Manual, contains critical ; information concerning AST's and their service. ; ; The parameter supplied with the call to gtdp is the WORD ; offset from the top of the stack AS SPECIFIED IN THE ; EXEC MANUAL to the AST parameter of ; interest. There are 7 (11 for 'M-plus) variations of ; the task's stack at AST, as explained in that ; section. For example, if the AST was due to the ; expiration of a mark time, variation #5, the gtdp ; function would return the following: ; ; gtdp(0) Event flag [trap-dependent] ; gtdp(1) Task's DSW [task state] ; gtdp(2) Task's old PC [task state] ; gtdp(3) Task's old PSW [task state] ; gtdp(4) Task's EF Mask [task state] ; ; Notes ; ; The parameter is a WORD offset. This is for safety, ; to avoid odd address traps, since the access in ; this routine is by word instructions. ; ; No checks are made for offset legality. ;- ; Edits: ; V1.0 12-Jun-80 RBD Initial Edit ; V1.1 30-Jun-80 RBD New calling sequence ; V1.2 09-Feb-82 RBD R0 & R1 saved under stackframe by astset(). No longer ; use C$PMTR etc. This is so hardwired it's pathetic! ; V1.3 10-Oct-82 RBD Change P-Section. Fix Documentation. ; gtdp:: mov 2(sp),r0 ;get word offset asl r0 ;make a byte offset add r5,r0 ;add base register mov 6(r0),r0 ;Get it accounting for saved R0 & R1 return ;and return it .end