include (++) xcall.bsi

You should ++INCLUDE ashinc:xcall.bsi at the start of your subroutine. This file is included in the standard A-Shell release (see notes on ASHINC), and includes some symbols and MAP statements which are used by the parameter passing routines. It will set the variable XCBCNT to the number of parameters passed to the subroutine, and will set up the following array structure with the types and sizes of all the parameters:

map1 XCBCNT,f,6                    ! # of parameters passed

map1 XCBSTRUCTX

   map2 XCBSTRUCT(30)              ! (max of 30 params to xcall)

      map3 XCB'PTYPE,b,2           ! (0=X, 2=S, 4=F, 6=B,+16=array)

      map3 XCB'PSIZE,b,2

 

Since this BSI includes code as well as MAP statements, you must position it so that comes before any executable code in your subroutine that deals with parameters. Note that it is not strictly necessary to ++INCLUDE xcall.bsi, unless you plan to use the MX_XCBDATAX routine for parameter passing, or you want to know the number and types of parameters that were passed.