FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


ALIGN OBJECTS IN COMMON BLOCKS

Syntax:

[DO NOT] ALIGN [OBJECTS IN] COMMON [BLOCKS]

Function:

The command ALIGN OBJECTS IN COMMON BLOCKS instructs FPT to compute addresses in COMMON blocks so that all objects start on aligned addresses. Note that the command does NOT change the code. Padding variables are not inserted in the COMMON block to enforce the alignment. This command determines the addresses which FPT allocates to the variables, and therefore the equivalence relationships between them.

An aligned address is an address which is a multiple of the alignment granularity of the object, where the first address of a COMMON block, of a group of equivalenced variables, or of a structure, is address zero.

The alignment granularity of a numeric object is computed as the system granularity or the data size of the object, whichever is the smaller. The system granularity is specified by the command ALIGNMENT GRANULARITY.

For the purpose of this command, the alignment granularity of an object of type character is one byte. This differs from the computation used in the CHECK ALIGNMENT command, but conforms to the behaviour of most compilers which force alignment. However, character variables are usually accessed more efficiently if they start on aligned addresses.

The alignment granularity of objects of type RECORD is computed as the granularity of the largest object within the record.

Note that some Fortran compilers have compilation switches to force alignment of objects, and that some force alignment silently, without warning. It is important to find the behaviour of the system in use. When new code is developed, it is recommended that users do not force the alignment of objects with this command, but check the alignment of objects with the command CHECK ALIGNMENT.

Where to use this command:

Operating system command line

Yes


Configuration file, config.fsp

Yes


Specification (FSP) files, *.fsp

Yes


Interactively, to FPT> prompt:

No


Interactive command files

No


Embedded in the Fortran code

Yes


Default:

Alignment is not forced by default (Note that defaults may be changed in the configuration file)

Example:

In an FSP file for a Concept-32 machine:

%alignment granularity: 4
%align objects in common

See also:

ALIGN OBJECTS IN STRUCTURES

ALIGNMENT GRANULARITY

CHECK ALIGNMENT


Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.