Previous Up Next
JSA and JRA are a peculiar subroutine call and matching return which were invented for PDP-6 Fortran. In most programs they are not used at all.
JSR C(E)<-<flags,,PC>; PC<-E+1;JSR, Jump to SubRoutine, stores the PC in the word addressed by the effective address and jumps to the word following the word where the PC is stored. This is the only PDP-10 instruction that stores the PC and flags without modifying any ACs; however, it is non-reentrant, so PUSHJ is favored in most cases. The usual return from a subroutine called by a JSR is via JRST (or JRST 2,) indirect through the PC word. (See JRST)
JSP C(AC)<-<flags,,PC>; PC<-E;JSP, Jump and Save PC, stores the PC and flags in the selected accumulator and jumps.
JSA C(E)<-C(AC); C(AC)<-<E,,PC>; PC<-E+1;JSA, Jump and Save AC, stores the AC in word addressed by the effective address. Then the left half of the AC is set to the effective address and the right half of AC is set to the return PC. Then the PC is set to one greater than the effective address. The JRA instruction unwinds this call. The advantage of this call is that a routine may have multiple entry points (which is difficult to do with JSR) and it's easy to find (and later to skip over) arguments that follow the calling instruction (which is possible to do with PUSHJ, but not quite so convenient). Among the disadvantages of this call is that it is non reentrant, and it doesn't save flags.
JRA C(AC)<-C(CL(AC)); PC<-E;JRA, Jump and Restore AC, is the return from JSA. If, e.g., a subrountine is called with JSA AC, then the return is made by: