Pointer data items with AMODE 64 programs
One fundamental difference between LP(64)
and LP(32)
is
the size of address fields in the underlying generated program code.
The storage allocation for some data items depends on the setting
of the LP
compiler option.
About this task
To access the larger addressing space, data items with USAGE
POINTER
, USAGE FUNCTION-POINTER
, and USAGE
INDEX
are 8 bytes when LP(64)
is in effect,
and 4 bytes when LP(32)
is in effect; data items with USAGE PROCEDURE-POINTER
are
8-byte elementary items regardless of the LP compiler option setting.
LENGTH
OF
special register
LENGTH OF
special
register has the following implicit definition with LP(64)
:PICTURE 9(18) USAGE IS BINARY.
LP(32)
is:PICTURE 9(9) USAGE IS BINARY.
This
can affect the size of group items that contain these data items.
If the group item is defined in a COBOL copybook, and if the copybook
is used in both LP(64)
and LP(32)
compilations,
you should be aware that the difference in size might affect the program
logic.
USAGE POINTER-32
data item
A new data item with USAGE POINTER-32
is added to the compiler when introducing
AMODE 64 support. This can be used with the LP(64)
or LP(32)
compiler option, and can be used to define the pointer data item that contains below the bar address
regardless of whether the data item is used in an AMODE 64 or AMODE 31 program. The same copybook
can then be shared between LP(64)
and LP(32)
programs.
LP
FUNCTION-POINTER phrase (Enterprise COBOL for z/OS® Language Reference)
INDEX phrase (Enterprise COBOL for z/OS Language Reference)
LENGTH OF (Enterprise COBOL for z/OS Language Reference)
POINTER phrase (Enterprise COBOL for z/OS Language Reference)
POINTER-32 phrase (Enterprise COBOL for z/OS Language Reference)
PROCEDURE-POINTER phrase (Enterprise COBOL for z/OS Language Reference)