AMODE

Restriction: This directive is supported in native COBOL only.

Syntax:

 >>-.---.-.----.--AMODE--"format"-------------><  
    +-/-+ +-NO-+

Parameters:

format
The storage format of pointers:
24
All pointers are stored in a 24-bit format. This format is compatible with "below-the-line" storage on the mainframe. The top 8 bits of the pointer are masked off when the address of a linkage item is set from the pointer. This means that, as on the mainframe, the top 8 bits can be manipulated directly by the user's code.
31
All pointers are stored in a 31-bit format. This format is compatible with "above-the-line" storage on the mainframe. The top bit of the pointer is masked off when the address of a linkage item is set from the pointer. This means that, as on the mainframe, the top bit can be manipulated directly by the user's code.

Properties:

Default: NOAMODE
Phase: Syntax check
$SET: Initial

Dependencies:

AMODE"31" sets DATA"31" immediately.

Comments:

The AMODE directive must be used with any program module which:

  • Must create mainframe-style pointer items (using SET pointer-item TO ADDRESS OF data-item syntax)
  • Uses mainframe-style pointer items (using SET ADDRESS OF linkage-item TO pointer-item syntax)
  • Contains a working-storage item that will be passed to a subprogram that creates a mainframe-style pointer item to point to that working-storage item

In general, to eliminate potential problems that might occur when trying to be selective about which programs are compiled with this directive, we strongly recommended that you use the AMODE directive on all programs in the application, and that you use the same value for format for each subprogram.

The AMODE directive cannot be used for programs that need to call a Micro Focus library routine or an external API that expects pointer items to be in the native machine format.