C and C++ generally support a single character string as a parameter to a main routine. They parse the string into tokens that are accessed by the argc and argv parameters of the main function.
In addition, there are alternate styles of passing a set of parameters to the main routine, for example: as a single value, a pointer to a value, or a pointer to a list of values. In these cases, the set of parameters is not parsed. It is assumed that the invoker of the application (for example, the operating system) has stored the address of the set of parameters in register 1 before entry into the main routine. Depending on how the parameters are passed, register 1 points on entry to the entities illustrated in Figure 1:
The first arrangement in Figure 1 can be used only for parameters that are integers.
The third style is also supported for certain macros and functions (for example, __pcblist and __csplist for invokers IMS™ and Cross System Product). __osplist is a generalization of the more specialized __pcblist and __csplist macros; it can be used in their place or in cases where they do not apply.
Figure 2 illustrates how these macros can be used to access items in the three alternate parameter arrangements.
Suitable casting and dereferencing are required when using these macros, as shown in Figure 3, according to the parameter passing style in use.