18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

This can provide a second method of equivalencing attributes: If two attributes are explicitly assigned<br />

to the same word number within an entity structure, they are equivalenced. Care should be<br />

taken that this is not done inadvertently. Some implementations insist that such equivalencing be<br />

recognized by enclosing the attribute names in parentheses, as is done when explicitly equivalencing<br />

an attribute group. In addition, there are certain restrictions on equivalencing attributes of different<br />

modes. In general, for example, text mode variables may not be equivalenced with other<br />

modes because of the way text is implemented through pointer values. Any inconsistent usage<br />

of these pointers could give rise to serious errors.<br />

Attributes of permanent entities and system attributes are not assigned to words, but a similar effect<br />

is achieved by using the clause in array i, where i is an integer constant. This array may be<br />

thought of as comprising the structure of the system entity.<br />

In certain implementations, such explicit assignment, either for temporary or permanent entities,<br />

may be recognized by the compilation process, leading to efficiencies at program execution time.<br />

It may also affect the requirements for independent compilation of the routines in a program. Consult<br />

the appropriate user manual for implementing specific details of packing and equivalencing.<br />

Obviously, the use of these features may give rise to problems if a program is to be transported<br />

across different systems.<br />

The results of packing, equivalence, and word and array specification are shown in table 6-3.<br />

Table 6-3. Attribute Specifications<br />

Specification<br />

No packing, equivalence, or word or array specification<br />

Word or array specification<br />

Assignment<br />

Attributes assigned to separate words or arrays in<br />

the order of their appearance in preamble<br />

Attributes are assigned to specified words or array<br />

locations. Remaining attributes assigned as above.<br />

Equivalence specification<br />

Packing specification<br />

Specified attributes assigned to the same word or<br />

array<br />

Field and bit packing used to place more than one<br />

attribute within a computer word<br />

Intrapacking used to compress storage for arrays<br />

The every statement optionally permits detailed specification of the attributes of an entity. The<br />

use of packing factors, equivalence parentheses, and word and array clauses gives a programmer<br />

a good deal of control over the allocation of computer storage.<br />

270

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!