COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-62
ENTER
Addressing Parameters
All native instructions use 32-bit addressing. Some TNS instructions use 16-bit
addressing and others use 32-bit addressing. Those that use 16-bit addressing
execute faster, but cannot address data items in extended memory. The code in an
called routine that handles parameters specified in the calling program is
generated according to the addressing mode of the data descriptions in the called
routine.
Many COBOL data items are byte-addressed. Some data items in other languages
are 2-byte-addressed. This means different things in a TNS program and in native
program.
In a TNS program, when you pass a byte-addressed parameter to a routine that
expects a 2-byte-addressed parameter, the compiler shifts the byte address to the
right to produce a 2-byte address. The data item must begin in the leftmost byte;
otherwise, problems can arise. The compiler issues a warning if there is any
possibility of this happening (because the offset within the record is odd, the data
item is a table with odd element size, or the data item is within a table).
In a native program, when you pass a byte-addressed parameter to a routine that
expects a 2-byte-addressed parameter, the data item must be aligned on a 2-byte
boundary; otherwise, problems can arise, because the called routine is expecting
an aligned parameter. The compiler does not issue a warning in this case.
°
TNS HP COBOL
TNS HP COBOL programs use 16-bit addressing for all items in the File
Section and the Working-Storage Section. They use 32-bit addressing for all
data items in the Extended-Storage section and all data items in the Linkage
Section that are not described as having STANDARD access mode.
Any TNS HP COBOL data item except a special register or a data item
declared in the Extended-Storage Section can correspond to a 16-bit-
addressed reference parameter of the called routine.
Any TNS HP COBOL data item except a special register can correspond to a
32-bit-addressed reference parameter of the called routine.
°
FORTRAN (TNS only)
Each FORTRAN routine uses the same addressing mode for all parameters it
receives or passes—16-bit addressing by default, 32-bit addressing if the
routine is compiled with the EXTENDEDREF or LARGECOMMON directive.
(The LARGECOMMON directive also causes common blocks to be allocated in
extended memory.) All FORTRAN routines bound into one object file must use
the same addressing mode.