For each implementation there is a predefined library package called SYSTEM which includes the definitions of certain configuration-dependent characteristics. The specification of the package SYSTEM is implementation-dependent and must be given in Appendix F. The visible part of this package must contain at least the following declarations.

package SYSTEM is

type ADDRESS is implementation_defined; type NAME is implementation_defined_enumeration_type;

SYSTEM_NAME : constant NAME := implementation_defined;

STORAGE_UNIT : constant := implementation_defined; MEMORY_SIZE : constant := implementation_defined;

--System-Dependent Named Numbers:

MIN_INT : constant := implementation_defined; MAX_INT : constant := implementation_defined; MAX_DIGITS : constant := implementation_defined; MAX_MANTISSA : constant := implementation_defined; FINE_DELTA : constant := implementation_defined; TICK : constant := implementation_defined;

--Other System_Dependent Declarations

subtype PRIORITY is INTEGER range implementation_defined;

... end SYSTEM;

The type ADDRESS is the type of the addresses provided in address clauses; it is also the type of the result delivered by the attribute ADDRESS. Values of the enumeration type NAME are the names of alternative machine configurations handled by the implementation; one of these is the constant SYSTEM_NAME. The named number STORAGE_UNIT is the number of bits per storage unit; the named number MEMORY_SIZE is the number of available storage units in the configuration; these named numbers are of the type universal_integer.

An alternative form of the package SYSTEM, with given values for any of SYSTEM_NAME, STORAGE_UNIT, and MEMORY_SIZE, can be obtained by means of the corresponding pragmas. These pragmas are only allowed at the start of a compilation, before the first compilation unit (if any) of the compilation.

pragma SYSTEM_NAME (enumeration_literal);

The effect of the above pragma is to use the enumeration literal with the specified identifier for the definition of the constant SYSTEM_NAME. This pragma is only allowed if the specified identifier corresponds to one of the literals of the type NAME.

pragma STORAGE_UNIT (numeric_literal);

The effect of the above pragma is to use the value of the specified numeric literal for the definition of the named number STORAGE_UNIT.

pragma MEMORY_SIZE (numeric_literal);

The effect of the above pragma is to use the value of the specified numeric literal for the definition of the named number MEMORY_SIZE.

The compilation of any of these pragmas causes an implicit recompilation of the package SYSTEM. Consequently any compilation unit that names SYSTEM in its context clause becomes obsolete after this implicit recompilation. An implementation may impose further limitations on the use of these pragmas. For example, an implementation may allow them only at the start of the first compilation, when creating a new program library.

Note:

It is a consequence of the visibility rules that a declaration given in the package SYSTEM is not visible in a compilation unit unless this package is mentioned by a with clause that applies (directly or indirectly) to the compilation unit.

References: address clause, apply, attribute, compilation unit, must, named number, number declaration, numeric literal, package, package specification, pragma, program library, type, visibility, visible part, with clause.

Sub-topics:

- 13.7.1 System-dependent Named Numbers
- 13.7.2 Representation Attributes
- 13.7.3 Representation Attributes of Real Types

Within the package SYSTEM, the following named numbers are declared. The numbers FINE_DELTA and TICK are of the type universal_real; the others are of the type universal_integer.

- MIN_INT The smallest (most negative) value of all predefined integer types.

- MAX_INT The largest (most positive) value of all predefined integer types.

- MAX_DIGITS The largest value allowed for the number of significant decimal digits in a floating point constraint.

- MAX_MANTISSA The largest possible number of binary digits in the mantissa of model numbers of a fixed point subtype.

- FINE_DELTA The smallest delta allowed in a fixed point constraint that has the range constraint -1.0 .. 1.0.

TICK The basic clock period, in seconds.

References: allow, delta of a fixed point constraint, fixed point constraint, floating point constraint, integer type, model number, named number, package, range constraint, system package, type, universal_integer type, universal_real type.

The values of certain implementation-dependent characteristics can be obtatined by interrogating appropriate representation attributes. These attributes are described below.

For any object, program unit, label, or entry X:

- X'ADDRESS Yields the address of the first of the storage units allocated to X. For a subprogram, package, task unit or label, this value refers to the machine code associated with the corresponding body or statement. For an entry for which an address clause has been given, the value refers to the corresponding hardware interrupt. The value of this attribute is of the type ADDRESS defined in the package SYSTEM.

For any type or subtype X or for any object X:

- X'SIZE Applied to an object, yields the number of bits allocated to hold the object. Applied to a type or subtype, yields the minimum number of bits that is needed by the implementation to hold any possible object of this type or subtype. The value of this attribute is of the type universal_integer.

For the above two representation attributes, if the prefix is the name of a function, the attribute is understood to be an attribute of the function (not of the result of calling the function). Similarly, if the type of the prefix is an access type, the attribute is understood to be an attribute of the prefix (not of the designated object: attributes of the latter can be written with a prefix ending with the reserved word all).

For any component C of a record object R:

- R.C'POSITION Yields the offset, from the start of the first storage unit occupied by the record, of the first of the storage units occupied by C. This offset is measured in storage units. The value of this attribute is of the type universal_integer.

- R.C'FIRST_BIT Yields the offset, from the start of the first of the storage units occupied by C, of the last bit occupied by C. This offset is measured in bits. The value of this attribute is of the type universal_integer.

- R.C'LAST_BIT Yields the offset, from the start of the first of the storage units occupied by C, of the last bit occupied by C. This offset is measured in bits. The value of this attribute is of the type universal_integer.

For any access type or subtype T:

- T'STORAGE_SIZE Yields the total number of storage units reserved for the collection associated with the base type of T. The value of this attribute is of the type universal_integer.

For any task type or task object T:

- T'STORAGE_SIZE Yields the number of storage units reserved for each activation of a task of the type T or for the activation of the task object T. The value of this attribute is of the type universal_integer.

Notes:

For a task object X, the attribute X'SIZE gives the number of bits used to hold the object X, whereas X'STORAGE_SIZE gives the number of storage units allocated for the activation of the task designated by X. For a formal parameter X, if parameter passing is achieved by copy, then the attribute X'ADDRESS yields the address of the local copy; if parameter passing is by reference, then the address is that of the actual parameter.

References: access subtype, access type, activation, actual parameter, address clause, address predefined type, attribute, base type, collection, component, entry, formal parameter, and 6.2, label, object, package, package body, parameter passing, program unit, record object, statement, storage unit, subprogram, subprogram body, subtype, system predefined package, task, task body, task object, task type, task unit, type, universal_integer type.

For every real type or subtype T, the following machine-dependent attributes are defined, which are not related to the model numbers. Programs using these attributes may thereby exploit properties that go beyond the minimal properties associated with the numeric type (see section 4.5.7 for the rules defining the accuracy of operations with real operands). Precautions must therefore be taken when using these machine- dependent attributes if portability is to be ensured.

For both floating point and fixed point types:

- T'MACHINE_ROUNDS Yields the value TRUE if every predefined arithmetic operation on values of the base type of T either returns an exact result or performs rounding; yields the value FALSE otherwise. The value of this attribute is of the predefined type BOOLEAN.

- T'MACHINE_OVERFLOWS Yields the value TRUE if every predefined operation on values of the base type of T either provides a correct result, or raises the exception NUMERIC_ERROR in overflow situations (see 4.5.7); yields the value FALSE otherwise. The value of this attribute is of the predefined type BOOLEAN.

For floating point types, the following attributes provide characteristics of the underlying machine representation, in terms of the canonical form defined in section 3.5.7:

- T'MACHINE_RADIX Yields the value of the radix used by the machine representation of the base type of T (the digits are extended digits in the range 0 to T'MACHINE_RADIX -1). The value of this attribute is of the type universal_integer.

- T'MACHINE_EMAX Yields the largest value of exponent for the machine representation of the base type of T. The value of this attribute is of the type universal_integer.

- T'MACHINE_EMIN Yields the smallest (most negative) value of exponent for the machine representation of the base type of T. The value of this attribute is of the type universal_integer.

Note: For many machines the largest machine representable number of type F is almost

(F'MACHINE_RADIX)**(F'MACHINE_EMAX),

and the smallest positive representable number is

F'MACHINE_RADIX ** (F'MACHINE_EMIN -1)

References:arithmetic operator, attribute, base type, boolean predefined type, false boolean value, fixed point type, floating point type, model number, numeric type, numeric_error exception, predefined operation, radix, real type, subtype, true boolean value, type, universal_integer type.