Subroutine Call/Return Stack
Original Publication Date: 1988-Apr-01
Included in the Prior Art Database: 2005-Feb-15
Subroutine linkage in System 370/XA programs is usually accomplished through the Branch and Link (BAL/BALR) or Branch and Save (BAS/BASR/BASSM) instruction for the call and the Branch Register (BR) or Branch and Set Mode (BSM) instruction for the return. These are unusually difficult to predict via a Branch History Table (BHT) because the same branch instruction in storage may have several different targets corresponding to different points from which the subroutine is called. Several solutions to this problem have been proposed, generally involving a stack that attempts to match "return" will go to the instruction immediately following the "call". This matching is made difficult, however, by the fact that these instructions have other uses besides subroutine linkage, and any mismatch will cause the stack to get out of sync.