

            stk$xs (4) --- set/read stack extension pointer          06/25/82


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 subroutine stk$xs (root, ptr_to_ext)
                 shortcall stk$xs (4)

                 integer root
                 pointer ptr_to_ext

                 Library: shortlb
                 Also declared in =incl=/shortlb.r.i


            _F_u_n_c_t_i_o_n

                 The Prime machines support the mechanism of a stack that can
                 be  extended  into  additional  segments,  as  needed.  This
                 routine allows you to set  the  extension  pointer  for  any
                 stack,  or read the current extension pointer for any stack.
                 The function's actions depend on the value of  'root'  (seg-
                 ment of stack root):

                      If  (root  ==  :100000)  then  the function returns the
                      current extension pointer in 'ptr_to_ext'.  (:100000 ==
                      ints(-32768))

                      If (root > -32768 & root < 0) then the function returns
                      in 'ptr_to_ext' the current extension pointer  for  the
                      stack whose root is in segment abs(root).

                      If  (root  ==  0)  then the function sets the extension
                      pointer  of  the  current  stack  to   the   value   of
                      'ptr_to_ext'.

                      If  (root  >  0)  then  the function sets the extension
                      pointer of the stack whose root is in segment 'root' to
                      the value in 'ptr_to_ext'.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 Implemented as a simple  PMA  routine  entered  via  a  JSXB
                 (shortcall).   If  the operation is specified as relative to
                 the current stack root then  the  stack  segment  number  is
                 taken from SB% + 1 (the current stack frame root pointer).

                 Note that any routine using this call must be compiled using
                 the "-q" option of 'fc'.


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 ptr_to_ext






            stk$xs (4)                    - 1 -                    stk$xs (4)




            stk$xs (4) --- set/read stack extension pointer          06/25/82


            _B_u_g_s

                 There  is  no  validity  checking  done on either the 'root'
                 parameter or the 'ptr_to_ext' parameter.

                 No validation is done to make sure that 'ptr_to_ext'  points
                 to a valid stack.

                 Locally supported.


            _S_e_e _A_l_s_o

                 fc (1), _S_y_s_t_e_m _A_r_c_h_i_t_e_c_t_u_r_e _R_e_f_e_r_e_n_c_e _G_u_i_d_e (Prime PDR 3060)












































            stk$xs (4)                    - 2 -                    stk$xs (4)


