|
|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 236928 (0x39d80)
Types: TextFile
Names: »D14«
└─⟦53be6501e⟧ Bits:30005867/disk02.imd Dokumenter (RCSL m.m.)
└─⟦this⟧ »D14«
ALGOL 7
Reference Manual
Third Edition
A/S REGNECENTRALEN April 1979
Information Department RCSL 42 - i 1279\f
Author: Hans Dinsen Hansen, Bodil Larsen
KEY WORDS: RC 4000, RC 6000, RC 8000, Basic Software, ALGOL,
Reference Manual.
ABSTRACT: This manual describes the RC ALGOL 7 language. The
description is based on the Reference Manual for
ALGOL 60.
SUPPORTING AND REFERENCED DOCUMENTS:
The list of supporting and referenced documents is
included just before last page of this manual.
Reservation
Copyright A/S Regnecentralen, 1979
Printed by A/S Regnecentralen, Copenhagen\f
TABLE OF CONTENTS Page
INTRODUCTION 9
1 NOTATION 10
2 BASIC SYMBOLS, IDENTIFIERS, NUMBERS AND STRINGS 11
2.0.1 Character set and coding 11
2.0.2 Source text 13
2.0.3 Source files 14
2.0.4 Space and New Line 14
2.1 Letters 15
2.2 Digits and Logical Values 16
2.2.1 Digits 16
2.2.2 Logical Values 16
2.3 Delimiters 16
2.4 Identifiers 19
2.4.1 Syntax 19
2.4.2 Examples 20
2.4.3 Semantics 20
2.5 Numbers 20
2.5.1 Syntax 20
2.5.2 Examples 21
2.5.3 Semantics 21
2.5.4 Types 21
2.5.5 Integer and Long Literals 21
2.5.6 Real literals 21
2.6 Strings 22
2.6.1 Syntax 22
2.6.2 Examples 23
2.7 Quantities, Kinds and Scopes 23
2.8 Values and Types 23
3 EXPRESSIONS 25
3.1 Variables and Fields 25
3.1.1 Syntax 25
3.1.2 Examples 26
3.1.3 Semantics 26
3.1.3.1 Zones and Record Variables 26
3.1.3.2 Fields 27
3.1.4 Subscripts 27
3.1.4.1 Subscripted variables 27
3.1.4.2 Subscript positions 27
3.1.4.3 Array fields 28 \f
3.1.5 Initial Values of Variables 28
3.1.6 Ranges of values. Type length. Binary patterns 28
3.1.6.1 Booleans 28
3.1.6.2 Integers 28
3.1.6.3 Longs 29
3.1.6.4 Reals 29
3.1.7 Reals used as semi-long integers 29
3.2 Function Designators 30
3.2.1 Syntax 30
3.2.2 Examples 31
3.2.3 Semantics 31
3.2.4 Standard functions 31
3.2.5 Transfer functions 31
3.3 Arithmetic expressions 31
3.3.1 Syntax 31
3.3.2 Examples 33
3.3.3 Semantics 33
3.3.4 Operators and types 35
3.3.4.1 Operators 35
3.3.4.2 Operations 35
3.3.4.2.1 Operation term'modfactor' 36
3.3.4.3 Operation factor'**primary' 36
3.3.4.4 Type of a conditional expression 36
3.3.4.5 Types of the monadic operators
and the pattern operators 36
3.3.5 Precedence of operators 37
3.3.5.1 Syntax 37
3.3.5.2 Expression 38
3.3.6 Arithmetic of real, long,
and integer quantities 38
3.4 Boolean expressions 39
3.4.1 Syntax 39
3.4.2 Examples 40
3.4.3 Semantics 40
3.4.4 Types 40
3.4.5 The operators 40
3.4.6 Precedence of operators 41
3.4.6.1 Syntax 41
3.4.6.2 The use of parentheses 41
3.4.7 Arithmetic of boolean quantities 41
3.5 Designational expressions 42
3.5.1 Syntax 42
3.5.2 Examples 42
3.5.3 Semantics 42
3.5.4 The subscript expression 42 \f
3.5.5 Switch versus case statement 43
3.6 String expressions 43
3.6.1 Syntax 43
3.6.2 Examples 43
3.6.3 Semantics 43
3.6.4 Types 44
3.6.5 Binary patterns 44
3.6.5.1 Text portion and short text string 44
3.6.5.2 Long text string 44
3.6.5.3 Layout string 45
3.6.5.4 Reference of strings 45
3.7 Zone expressions 46
3.7.1 Syntax 46
3.7.2 Examples 46
3.7.3 Semantics 46
4 STATEMENTS 47
4.1 Compound statements and blocks 47
4.1.1 Syntax 47
4.1.2 Examples 48
4.1.3 Semantics 49
4.2 Assignment statements 50
4.2.1 Syntax 50
4.2.2 Examples 50
4.2.3 Semantics 51
4.2.3.1 Location 51
4.2.3.2 Expression 51
4.2.3.3 Value of the expression 51
4.2.4 Types 51
4.3 Goto statements 52
4.3.1 Syntax 52
4.3.2 Examples 52
4.3.3 Semantics 52
4.3.4 Restriction 52
4.3.5 Goto an undefined switch designator 52
4.4 Dummy statements 52
4.4.1 Syntax 52
4.4.2 Examples 53
4.4.3 Semantics 53
4.5 Conditional Statements 53
4.5.1 Syntax 53
4.5.2 Examples 53
4.5.3 Semantics 54
4.5.3.1 If statement 54
4.5.3.2 Conditional if statement 54 \f
4.5.4 Goto into a conditional if statement 54
4.5.5 Case statement 55
4.5.5.1 Semantic 55
4.5.5.2 Example 55
4.6 Repetitive Statements 56
4.6.0.1 Syntax 56
4.6.0.2 For statements 56
4.6.1 Syntax 56
4.6.2 Examples 56
4.6.3 Semantics 56
4.6.4 The for list element 57
4.6.4.1 Arithmetic expression element 57
4.6.4.2 Step-until element 57
4.6.4.3 While element 57
4.6.5 The value of the controlled variable upon exit 58
4.6.6 Goto leading into a for statement 58
4.6.7 Repeat statement 58
4.6.8 Syntax 58
4.6.9 Examples 58
4.6.10 Semantics 58
4.6.11 While statement 58
4.6.12 Syntax 58
4.6.13 Examples 59
4.6.14 Semantics 59
4.7 Procedure statements 59
4.7.1 Syntax 59
4.7.2 Examples 59
4.7.3 Semantics 59
4.7.3.1 Value assignment (call by value) 60
4.7.3.2 Name replacement (call by name) 61
4.7.3.3 Body replacement and execution 61
4.7.4 Actual formal correspondance 61
4.7.5 Restrictions 61
4.7.5.1 String supplied as an actual parameter 61
4.7.5.2 Formal name parameter 62
4.7.5.3 Actual parmeter 62
4.7.5.4 (This section has been deleted) 62
4.7.5.5 Restrictions imposed by specifications 62
4.7.6 (This section has been deleted) 64
4.7.7 Parameter delimiters 64
4.7.8 Procedure body expressed in slang code 64
4.7.9 Standard procedures 64
4.7.10 Recursive procedures 64
4.8 Context statements 64
4.8.1 Syntax 64 \f
4.8.2 Examples 64
4.8.3 Semantics 65
5 DECLARATIONS 67
5.1 Type declarations 68
5.1.1 Syntax 68
5.1.2 Examples 68
5.1.3 Semantics 68
5.2 Array declarations 68
5.2.1 Syntax 68
5.2.2 Examples 69
5.2.3 Semantics 69
5.2.3.1 Subscript bounds 69
5.2.3.2 Dimensions 69
5.2.3.3 Types 69
5.2.4 Lower upper bound expressions 69
5.2.4.1 Expressions 69
5.2.4.2 Expressions 69
5.2.4.3 Array definition 70
5.2.4.4 Expressions 70
5.2.5 (This section has been deleted) 70
5.2.6 Lexicographical ordering 70
5.2.6.1 Multi-dimensional array
as actual parameter 71
5.2.6.2 Multi-dimensional array as field base 71
5.2.7 Bound halfwords and halfword numbering 71
5.2.8 Word boundaries and addresses 71
5.3 Switch declaration 72
5.3.1 Syntax 72
5.3.2 Examples 72
5.3.3 Semantics 72
5.3.4 Evaluation of expressions in the switch list 72
5.3.5 Influence of scopes 72
5.4 Procedure declaration 72
5.4.1 Syntax 72
5.4.2 Examples 73
5.4.3 Semantics 74
5.4.4 Values of function designators 75
5.4.5 Specifications 76
5.4.6 Code as procedure body 76
5.4.7 Procedure translated alone 76
5.4.7.1 Example 77
5.5 Zone declarations 77
5.5.1 Syntax 77
5.5.2 Examples 77
5.5.3 Semantics 77 \f
5.5.4 Types 79
5.5.5 Scope 79
5.5.6 Standard zones 80
5.5.7 Standard block procedure 80
5.6 Zone array declarations 80
5.6.1 Syntax 80
5.6.2 Examples 80
5.6.3 Semantics 80
5.6.4 Types 80
5.6.5 Scope 81
5.7 Field declarations 81
5.7.1 Syntax 81
5.7.2 Examples 81
5.7.3 Semantics 81
5.7.4 Location of a variable field 81
5.7.5 Location and bounds of an array field 82
5.8 Context declarations 83
5.8.1 Syntax 83
5.8.2 Examples 83
5.8.3 Semantics 83
5.8.3.1 Incarnation Interval 83
5.8.3.2 Initialization of Context Variables 84
5.8.3.3 Storage of Context Variables 84
5.8.3.4 Context Mode 85
5.8.4 Types 85
REFERENCES 86
INDEX 88 \f
F_ I_n_t_r_o_d_u_c_t_i_o_n_
This book contains the formal description of the ALGOL language
and the corresponding ALGOL 7 compiler used on RC 8000, RC 4000
and RC 6000.
The description of the reference language follows the structure
of Revised Report of ALGOL 60 (cf. ref. 11 and 12). The elements
which are in ALGOL 7 but not in ALGOL 60 are merged into this
description.
The book gives a syntax and a semantic description for all
language elements. Furthermore short examples are given to
illustrate the syntax, further examples are found in ref. 14
ALGOL 7 User's Manual.
Hans Dinsen Hansen has delivered the first manuscript to this
manual. Parts of the old ALGOL 6 manual are used.\f
F_ 1 N_o_t_a_t_i_o_n_
The syntax of the ALGOL 7 elements are described with aid of an
improved BNF (Backus-Naur FORM) where repetition suffixes are
used. (cf. ref. 15)
The following example and short explanation may help to under-
stand at least the basic idea of the language.
1*
transaction' ::= tr transdate' 0 trfield' 1
transdata' ::= day'.month'.19year'
payment'
trfield' ::= invoice'
or more compact: *
1payment'
transaction' ::= tr day'.month'.19year' 0 invoice'
1
A BNF description is composed of a set of statements, each one
naming and defining a syntactial unit or string by means of a de-
finition symbol ::= to the right of which the possible components
of the string are stated. (What is in fact defined is not a sing-
le string but a whole class of strings having the properties spe-
cified by the right side). The components may either be other
strings or data constants - i.e. sequences of so-called terminal
symbols which, in fact, are nothing but typographical representa-
tions of elements of the data spectrum. (In the example tr,. and
19).
A string is denoted by a name enclosed in brackets '. The name,
which may be a whole sentence, will normally be chosen to give
the reader some associations with the information represented by
the string. The order of the statements in a description is imma-
terial, but all referred strings must be defined somewhere else
in the description. On the other hand, the order of the compo-
nents to the right of the ::= symbol prescribe exactly the order
in which the data elements must appear. In this way concatenation
of the real data elements is implied in the description.
Alternative data structures are described as separate lines en-
closed in . The same bracket is used around repetitive data
structures. The repetive factor is specified by the lower and
upper bound numbers connected to the bracket. * denotes any num-
ber. \f
F_ 2 B_a_s_i_c_ _s_y_m_b_o_l_s_,_ _I_d_e_n_t_i_f_i_e_r_s_,_ _N_u_m_b_e_r_s_ _a_n_d_ _s_t_r_i_n_g_s_
The Algol 7 language is built up from the following basic
symbols:
letter'
basic symbol'::= digit'
logical value'
delimiter'
2.0.1 C_h_a_r_a_c_t_e_r_ _s_e_t_ _a_n_d_ _c_o_d_i_n_g_
The Algol 7 character set is a subset of the ISO 7-bit character
set extended with the Danish letters: æ, @, , , å, Å. (See ref.
13). At run time, the program may choose any alphabet, but the
ISO 7-bit code is offered as standard. It is possible in a
simple way to use paper tapes in flexowriter code as source and
data, because the i/o system may convert the code to ISO 7-bit
code (see ref. 3 and 14).
The table 2.1 shows for each character of the ISO 7-bit alphabet:
V: The internal value.
G: The graphic representation or the name of the character.
S: The character class as source to the translator.
D: The character class as data read with the standard
alphabet.
\f
T_ ____________T_a_b_l_e_ _2_._1_ _C_h_a_r_a_c_t_e_r_ _S_e_t_ _a_n_d_ _I_n_p_u_t_ _C_l_a_s_s_ ___________________
_V_ _ _G_ _ _ _S_ _ _ _ _ _ _ _D_ _ _V_ _ _G_ _ _S_ _ _ _ _ _ _ _D_ _ _V_ _ _G_ _S_ _ _ _ _ _ _ _D_ _ _V_ _ _ _G_ _ _ _S_ _ _ _ _ _ _ _D_ _
0 NUL blind 0 32 SP basic 7 64 @ graphic 7 96 graphic 7
1 SOH illegal 7 33 ! basic 7 65 A basic 6 97 a basic 6
2 STX illegal 7 34 " graphic 7 66 B basic 6 98 b basic 6
3 ETX illegal 7 35 > graphic 7 67 C basic 6 99 c basic 6
4 EOT illegal 7 36 < graphic 7 68 D basic 6 100 d basic 6
5 ENQ illegal 7 37 % graphic 7 69 E basic 6 101 e basic 6
6 ACK illegal 7 38 & basic 7 70 F basic 6 102 f basic 6
7 BEL illegal 7 39 basic 5 71 G basic 6 103 g basic 6
8 BS illegal 7 40 ( basic 7 72 H basic 6 104 h basic 6
9 HT illegal 7 41 ) basic 7 73 I basic 6 105 i basic 6
10NL basic 8 42 * basic 7 74 J basic 6 106 j basic 6
11 VT illegal 7 43 + basic 3 75 K basic 6 107 k basic 6
12 FF basic 8 44 , basic 7 76 L basic 6 108 l basic 6
13 CR blind 0 45 - basic 3 77 M basic 6 109 m basic 6
14 SO illegal 7 46 . basic 4 78 N basic 6 110 nbasic 6
15 SI illegal 7 47 / basic 7 79 Obasic 6 111 o basic 6
16 DLE illegal7 48 0 basic 2 80 P basic 6 112 p basic 6
17 DC1 illegal 7 49 1 basic 2 81 Q basic 6 113 q basic 6
18 DC2 illegal 7 50 2 basic 2 82 R basic 6 114 r basic 6
19 DC3 illegal 7 51 3 basic 2 83 S basic 6 115 s basic 6
20 DC4 illegal 7 52 4 basic 2 84 T basic 6 116 t basic 6
21 NAK illegal7 53 5 basic 2 85 U basic 6 117 u basic 6
22 SYN illegal 7 54 6 basic 2 86 V basic 6 118 v basic 6
23 ETB illegal 7 55 7 basic 2 87 W basic 6 119 w basic 6
24 CAN illegal 7 56 8 basic 2 88 X basic 6 120 x basic 6
25 EM basic 8 57 9 basic 2 89 Y basic 6 121 y basic 6
26 SUB illegal 7 58 : basic 7 90 Z basic 6 122 z basic 6
27 ESC illegal 7 59 ; basic 7 91 @ basic 6 123 æ basic 6
28 FS illegal 7 60 basic 7 92 Ø basic 6 124 basic 6
29 GS illegal 7 61 = basic 7 93 Å basic 6 125 å basic 6
30 RS illegal 7 62 ' basic 7 94 graphic 7 126 graphic 7
31 US illegal 7 63 ? graphic 7 95 _ in text 7 127 DEL blind 0
_ _ _ _________________________________________________________________
&_
D_,_D_a_t_a_ _c_l_a_s_s_e_s_
0,blind: The character is skipped by all read
procedures.
1,shift character: Not used in the standard alphabet.
\f
2,digits: May be used as digits in a number or in a
text string.
3,signs: May be used as a sign of number or in a text-
string.
4,decimal point: May be used as the decimal point of a number,
in a text string or in a field reference.
5,exponent mark: May be used as the exponent mark of a number
or in a text string.
6,letters: May be used as part of a text string. Will
terminate a number.
7,delimiters: Will terminate a number or a text string.
8,terminator: Works as class 7, but terminates a call of
readall. EM (25) will immediately terminate a
call of read or readstring.
S_,_S_o_u_r_c_e_ _t_e_x_t_ _c_l_a_s_s_e_s_
Basic: Significant in all contexts.
Blind: Skipped in all contexts.
Graphic: Allowed inside text strings and comments,
causes a warning outside.
Illegal: Produces a warning during the translation,
but does not harm.
In text: Works as a space inside text strings, blind
outside.
C_o_n_t_r_o_l_ _c_h_a_r_a_c_t_e_r_s_
The control characters which are used in algol are the following:
10,NL: New Line. The change-to-new-line character.
12,FF: Form Feed. Causes a change of page on the
printer, but works syntactically as New Line
outside text strings.
25,EM: End Medium. See 2.0.3.
32,SP: Space.
127,DEL: Delete. Used for overpunching of wrong
characters.
2.0.2 S_o_u_r_c_e_ _t_e_x_t_
The program consists either of one block, of one compound
statement, or of one procedure declaration surrounded by
"external" and "end".
All characters up to the first "begin" or "external" are skipped,\f
but appear in a possible listing.
After the last "end", the compiler reads as many characters as
are necessary to distinguish the "end" (usually a space or a new
line).
2.0.3 S_o_u_r_c_e_ _f_i_l_e_s_
The source text to the compiler consists of one or more f_i_l_e_s_ of
text as specified in the File Processor command that started the
translation. The compiler may read source files from standard
input devices such as paper tape, cards, typewriter, magnetic
tape, and backing storage.
A file terminates either when an E_M_-character is read from the
file or when the file physically is exhausted. A file on a roll
of paper tape is exhausted when the tape end is met. A file on
the backing storage is exhausted when the end of the backing
storage area is met. A file on magnetic tape is exhausted when
tape mark is met.
When the compiler meets the file termination before the source
text is complete, it looks for the next file specified in the
File Processor command and continues reading from that file. If
the list of files is exhausted, the compiler prints an error
message, generates the necessary number of string terminations
and "end"s, and compiles the program completed in this way.
The compiler handles the peripheral devices in accordance with
the rules of the File Processor (ref. 6 or 7).
2.0.4 S_p_a_c_e_ _a_n_d_ _N_e_w_ _L_i_n_e_
Space and New Line may be used freely in numbers and between
identifiers, compound symbols, and other delimiters. They are
not, however, allowed inside identifiers, compound symbols, or
delimiters.
Space and New Line are significant characters in a text string
and will be printed out at run time when the string is printed.
The character "_" represents a space inside strings, but is
completely blind outside. The latter property may be used to
divide identifiers and compound symbols (cf. 2.3). \f
T_ 2.1 L_e_t_t_e_r_s_
aA
bB
cC
dD
eE
fF
small letter'::= g capital letter'::=G
hH
iI
jJ
kK
lL
mM
nN
oO
pP
qQ
rR
sS
t T
uU
vV
wW
xX
y Y
zZ
æ@
Ø
åÅ
small letter'
letter' ::= capital letter'
Letters do not have individual meaning. They are used for forming
identifiers and strings (cf. sections 2.10 Identifiers, 2.12
&_ Strings).
\f
T_ 2.2 D_i_g_i_t_s_ _a_n_d_ _L_o_g_i_c_a_l_ _V_a_l_u_e_s_
2.2.1 D_i_g_i_t_s_
0
1
2
3
digit' ::=4
5
6
7
8
9
&_ Digits are used for forming numbers, identifiers, and strings.
T_ 2.2.2 L_o_g_i_c_a_l_ _v_a_l_u_e_s_
logical value' ::= true
false
&_ The logical values have a fixed obvious meaning.
T_2.3 D_e_l_i_m_i_t_e_r_s_
The underlined delimiters (compound symbols) of the reference
language are written without underlining. A Space or a New Line
&_ is required to separate a compound symbol from a preceding iden-
tifier or a succeeding letter or digit. Thus the delimiter space
is forbidden inside a delimiter, but the symbol " _" may be used
instead. The delimiter "goto" and "boolean" may not be written as
"go to" and "Boolean".
operator'
separator'
delimiter' ::= bracket'
declarator'
specificator'
compiler directive'
\f
T_ arithmetic operator'
relational operator'
operator' ::= logical operator'
sequential operator'
pattern operator'
&_ context operator'
T_ +
-
*
/
//
arithmetic operator' ::=mod
**
round
abs
entier
&_ extend
T_
=
relational operator' ::==
'=
'
&_'
T_ ==
='
or
logical operator' ::=!
and
&
&_ -,
T_ goto
if
then
else
sequential operator' ::= for
do
case
of
repeat
&_ while
T_ real
transfer operator' ::= long
&_ string
\f
T_ context operator' ::= exit
continue
add
pattern operator' ::= extract
extend
&_ shift
T_;
,
.
,
:
separator' ::= :=
_
step
until
while
&_ comment
T_ (
)
:
bracket' ::=:'
'
*
*'
begin
&_ end
T_
own
boolean
integer
long
real
declarator' ::= array
switch
zone
procedure
&_ context
field
\f
T_ string
specificator' ::= label
&_ value
T_ algol
compiler directive' ::= external
&_ message
Delimiters have a fixed meaning which for the most part is
obvious, or else will be given at the appropriate place in the
sequel.
For the purpose of including text among the symbols of a program
the following "comment" conventions hold:
T_ The sequence of basic symbols: is equivalent with
;commentany sequence not containing";"';;
begin commentany sequence not containing";"'; begin
end any sequence not containing "end",";",
"else" or "until"' end
;message any sequence not containing";"'; ;
begin message any sequence not containing";"'; begin
&_ * any sequence not containing "*" or "*'" ' *' space
By equivalence is here meant that any of the structures shown in
the left hand column may, in any occurrence outside of strings,
be replaced by the symbol shown on the same line in the right
hand column without any effect on the action of the program. The
comment structure encountered first in the text when reading from
left to right has precedence in being replaced over later struc-
tures contained in the sequence.
T_2.4 I_d_e_n_t_i_f_i_e_r_s_
2.4.1 S_y_n_t_a_x_
*
identifier' ::= letter' letter'
digit'
&_ 0
The words for compound symbols (see 2.6.1 and 2.7) can never be
used as identifiers.
\f
T_ 2.4.2 E_x_a_m_p_l_e_s_:_
q
Soup
V17a
a34kTMNs
MARILYN
goto go _to Both are interpreted as the deli-
miter "goto".
go to An erroneous construction consis-
ting of two identifiers.
13 do a7:= The number 13, the delimiter "do",
the identifier a7, and the delimi-
ter :=
begin of _line : = An erroneous construction consis-
ting of the delimiter "begin", the
identifier "of _line", the delimiter :
and the delimiter =
&_
2.4.3 S_e_m_a_n_t_i_c_s_
Identifiers have no inherent meaning, but serve for the identifi-
cation of simple variables, arrays, labels, switches, procedures,
field variables, zones, and zone arrays. They may be chosen free-
ly, except for the limitation mentioned above.
The same identifier cannot be used to denote two different quan-
tities except when these quantities have disjoint scopes as de-
fined by the declarations of the program (cf. section 2.7 Quan-
tities, Kinds and Scopes and section 5. Declarations).
T_ 2.5 N_u_m_b_e_r_s_
2.5.1 S_y_n_t_a_x_
*
unsigned integer'::= digit'
&_ 1
T_ + 1
&_ integer'::= - 0 unsigned integer'
decimal fraction'::= .unsigned integer'
exponent part'::= "integer' \f
T_ 1
decimal number'::= unsigned integer' decimal fraction'
&_ decimal fraction' 0
T_ 1
unsigned number'::= decimal number' exponent part'
&_ exponent part' 0
T_ +1
&_ number'::= -0unsigned number'
The numbers of digits are restricted, (cf. sections 2.5.5 and
2.5.6).
T_ 2.5.2 E_x_a_m_p_l_e_s_
0 -200.084 -.083"-02
177 +07.43"8 -"7
.5384 9.34"+10 "-4
&_ +0.7300 2"-4 +"+5
2.5.3 S_e_m_a_n_t_i_c_s_
Decimal numbers have their conventional meaning. The exponent
part is a scale factor expressed as an integral power of 10.
2.5.4 T_y_p_e_s_
Integers are either of type integer or of type long, depending
on the value. All other representable numbers are of type real.
2.5.5 I_n_t_e_g_e_r_ _a_n_d_ _l_o_n_g_ _l_i_t_e_r_a_l_s_
Integers and longs may not exceed the interval
-140 737 488 355 327 _ integer _ 140 737 488 355 327.
If the literal is within the interval
-8 388 607 _ integer _ 8 388 607
it is classified as being of type integer. Outside this interval
it is classified as being of type long (cf. section 3.3.4).
2.5.6 R_e_a_l_ _l_i_t_e_r_a_l_s_
The real may not have more than 14 significant digits or 14 deci-
mals. The exponent part may not exceed the interval
-1000 exponent 1000. The total number is confined to the
range -1.6"616 _ number _ 1.6"616.
The number is converted to internal binary form using the same\f
methods as the procedures read and readall. The relative error
of the result is about 3>-11.
T_ 2.6 S_t_r_i_n_g_s_
2.6.1 S_y_n_t_a_x_
string literal'::= text string'
layout string'
&_
text string'::=
:any sequence of text symbols not containing ":'"or ":"':'
layout string'::= layout' '
layout'::=
T_11 1
&_ spaces' 0 sign' 0 layout number part' layout exponent part' 0
T_*
&_ spaces'::= space' 1
space'::= _
T_ +
&_ sign'::= -
T_ first letter'd>s'.d>s'zeroes'
&_ layout number part'::= first letter'd>s'zeroes'.zeroes'
T_ z
d
first letter'::= f
&_ b
T_1*
&_ d>s'::= space' 0 d 0
T_ 1*
&_ zeroes'::= space' 0 0 0
layout exponent part'::= >sign'first letter'd>s'
A text symbol is a character belonging to one of the classes
basic, graphic, or in text (see 2.0.1) or it is a positive
integer of at most 3 digits enclosed in '. The latter construc-\f
tion has precedence over the character by character interpreta-
tion, and represents the character with the integer as internal
value. The value must obey 0 value 128. The general string
concept is described in 3.6.
T_ 2.6.2 E_x_a_m_p_l_e_s_
:ab 99''d:' will be printed by a running
program as
ab c'd
&_ _-d.ddd>+d' is a layout string.
T_ 2.7 Q_u_a_n_t_i_t_i_e_s_,_ _k_i_n_d_s_ _a_n_d_ _s_c_o_p_e_s_
The following k_i_n_d_s_ of quantities are distinguished: simple va-
&_ riables, arrays, labels, switches, procedures, field variables,
zones and zone arrays.
The s_c_o_p_e_ of a quantity is the set of statements and expressions
in which the declaration of the identifier associated with that
quantity is valid. For labels see section 4.1.3.
T_ 2.8 V_a_l_u_e_s_ _a_n_d_ _t_y_p_e_s_
A v_a_l_u_e_ is an ordered set of numbers (special case: a single
&_ number), an ordered set of logical values (special case: a
single logical value), or a label.
Certain of the syntactic units are said to possess values. These
values will in general change during the execution of the pro-
gram. The values of expressions and their constituents are de-
fined in section 3. The value of an array identifier is the or-
dered set of values of the corresponding array of subscripted
variables (cf. section 3.1.4.1).
The value of a zone is a set of values called the zone descrip-
tor, plus a set of values in the zone buffer area, plus a set of
values called the share descriptors (see 5.5).
The value of a zone array is the set of values of the correspon-
ding subscripted zones.
The various t_y_p_e_s_ (integer, real, long, boolean) basically de-
note properties of values. The types associated with syntactic
units refer to the values of these units. \f
A field variable possesses an integer value, but has an associa-
ted type denoting the type of a field. A field is either a simple
field or an array field. Fields are subsets of arrays or
zones. Variable fields posses a single value. Array fields are
one dimensional arrays. \f
F_ 3 E_x_p_r_e_s_s_i_o_n_s_
In the language the primary constituents of the programs descri-
bing algorithmic processes are arithmetic, boolean, designatio-
nal, zone, and string expressions. Constituents of these expres-
sions, except for certain delimiters, are logical values, num-
bers, variables, function designators, and elementary arithmetic,
relational, logical, pattern, and sequential operators. Since the
syntactic definition of both variables and function designators
contains expressions, the definition of expressions, and their
constituents, is necessarily recursive.
T_ arithmetic expression'
boolean expression'
expression'::= designational expression'
string expression'
&_ zone expression'
3.1 V_a_r_i_a_b_e_l_s_ _a_n_d_ _f_i_e_l_d_s_
3.1.1 S_y_n_t_a_x_
variable identifier' ::= identifier'
simple variable' ::= variable identifier'
simple field variable' ::= identifier'
array field variable' ::= identifier'
field variable' ::= simple field variable'
array field variable'
subscript expression' ::= arithmetic expression'
*
subscript list' ::= subscript expression' ,subscript expression' 0
array identifier' ::= identifier'
zone identifier' ::= identifier'
zone array identifier' ::= identifier'
zone expression' ::= zone identifier'
zone array identifier'(subscript expr.')
field base' ::= array identifier'
zone expression'
array field'
array field' ::= field base'.array field variable'
simple field' ::= field base'.simple field variable'
record variable' ::= zone identifier'(subscript expression')
zone array ident.'(subscr. expr.',subscr. expr.')\f
T_ subscripted variable' ::= array identifier'(subscript list')
&_ array field'(subscript expression')
T_ simple variable'
simple field'
variable' ::= subscripted variable'
record variable'
&_ field variable'
T_ field reference' ::= array field'
simple field'
&_ field' ::= field reference'
T_ 3.1.2 E_x_a_m_p_l_e_s_
epsilon
detA
a17
Q(7, 2)
x(sin(n*pi/2), Q(3, n, 4))
P.type
&_ term (termno).entry
3.1.3 S_e_m_a_n_t_i_c_s_
A v_a_r_i_a_b_l_e_ is a designation given to a single value. This value
may be used in expressions for forming other values and may be
changed at will by means of assignment statements (section 4.2).
The t_y_p_e_ _o_f_ _a_ _s_i_m_p_l_e_ _v_a_r_i_a_b_l_e_ is defined in the declaration of
the variable itself (cf. section 5.1 Type declaration).
The t_y_p_e_ _o_f_ _a_ _v_a_r_i_a_b_l_e_ _f_i_e_l_d_ is defined in the declaration of the
simple field variable (cf. section 5.7 Field declaration).
The t_y_p_e_ _o_f_ _a_ _s_u_b_s_c_r_i_p_t_e_d_ _v_a_r_i_a_b_l_e_ is defined in the declaration
of the array identifier (cf. section 5.2 Array declaration) or in
the declaration of the ultimate array field variable defining the
array field (cf. section 5.7 Field declaration).
The t_y_p_e_ _o_f_ _a_ _r_e_c_o_r_d_ _v_a_r_i_a_b_l_e_ is real, and the type of a field
variable is integer.
3.1.3.1 Z_o_n_e_s_ _a_n_d_ _r_e_c_o_r_d_ _v_a_r_i_a_b_l_e_s_._ Record variables designate values
which are components of zone buffer areas. The subscript expres-
sions are evaluated like subscripts of ordinary subscripted va-
riables.
In case of a zone array with subscripts, the first subscript ex-\f
pression selects a zone from the zone array. This subscript must
obey
1_subscript_number of zones declared in zone array.
The last subscript selects a variable within the zone record,
which in turn is a set of consecutive variables of the selected
zone buffer area. This subscript must obey
1_subscript_number of variables currently in the record.
When an expression is assigned to a record variable, the location
(see 4.2.3) of the selected buffer element is not influenced by
possible changes of the record caused by procedure calls in the
right hand expression.
T_ 3.1.3.2 F_i_e_l_d_s_
Fields are subsets of arrays and zone records. A field consists of
a number of halfwords located within an array or a zone. This ar-
&_ray or zone is the field base for the field. A field variable is
a pointer indicating a field within an array, a zone record, or
an array field. The type of the field depends only upo a type de-
clared together with the field variable (cf. section 5.7 Field
declaration). All the halfwords of a simple field must be located
within the field base.
T_ 3.1.4 S_u_b_s_c_r_i_p_t_s_
3.1.4.1 S_u_b_s_c_r_i_p_t_e_d_ _v_a_r_i_a_b_l_e_s_ may designate values which are components
of multidimensional arrays (cf. section 5.2 Array declarations).
&_Each arithmetic expression of the subscript list occupies one
subscript position of the subscripted variable, and is called a
subscript. The complete list of subscripts is enclosed in the
subscript brackets (). The array component referred to by a sub-
scripted variable is specified by the actual numerical value of
its subscripts (cf. section 3.3 Arithmetic expressions).
T_ 3.1.4.2 E_a_c_h_ _s_u_b_s_c_r_i_p_t_ _p_o_s_i_t_i_o_n_ acts like a variable of type integer and
the evaluation of the subscript is understood to be equivalent
&_ to an assignment to this fictive variable (cf. section 4.2.4).
The value of the subscripted variable is defined only if the
value of the subscript expression is within the subscript bounds
of the array (cf. section 5.2 Array declarations). \f
T_3.1.4.3 A_n_ _a_r_r_a_y_ _f_i_e_l_d_ is an array always considered one dimensional. The
ordering of the halfwords in the field base and in the array
field follows the lexicographical ordering (cf. 5.2.6 Lexicogra-
&_phical ordering) The subscript bounds are defined by means of the
halfword bounds (cf. 5.2.7). The halfword bounds for the array
field are obtained by subtracting the value of the array field
variable from the halfword bounds of the field base (possibly an
array field). An element must be located within the field base.
T_3.1.5 I_n_i_t_i_a_l_ _v_a_l_u_e_s_ _o_f_ _v_a_r_i_a_b_l_e_s_
The value of a variable, not declared own or context, is unde-
fined from entry into the block in which it is declared until an
&_assignment is made to it.
The value of a variable declared own or context is binary zero
(if arithmetic) or false (if boolean) on first entry to the block
in which it is declared. On subsequent entries it has the same
value as at the preceding exit from the block.
T_ 3.1.6 R_a_n_g_e_s_ _o_f_ _v_a_l_u_e_s_._ _T_y_p_e_ _l_e_n_g_t_h_._ _B_i_n_a_r_y_ _p_a_t_t_e_r_n_s_
Depending on the type, each variable is represented by an inte-
&_gral number of halfwords. Each halfword is of 12 bits. The number
of halfwords representing a variable is called the t_y_p_e_ _l_e_n_g_t_h_.
The type length may some times be expressed in bits.
T_ 3.1.6.1 B_o_o_l_e_a_n_s_ are represented as 12 bits quantities. The type length
of a boolean variable is 1 halfword. The binary pattern of a
&_boolean is extended with zeroes to the left whenever needed. The
last of the 12 bits is 0 when the boolean is false, 1 when it is
true.
The logical constants "true" and "false" and the result of apply-
ing the relational operators will always be 12 zeroes for false,
12 ones for true. Other binary patterns may be obtained by ap-
plying the operators add and shift. The 5 logical operators work
on all 12 bits in parallel.
T_ 3.1.6.2 I_n_t_e_g_e_r_s_ are represented in 24-bits, 2"s complement, binary form.
This gives the range:
-8 388 608 _ integer _ 8 388 607.
&_The type length of an integer variable is 2 halfwords, and the
binary pattern of an integer is the 24 bites of its representa-
tion extended with zeroes to the left whenever needed. The binary
patterns are used in connection with the operators add, extract,
and shift. \f
T_ 3.1.6.3 L_o_n_g_s_ are represented in 48 bits, 2"s complement, binary form.
The range of longs should be confined to:
-140 737 488 355 327 _ long _ 140 737 488 355 327.
&_The type length of a long variable is 4 halfwords, and the binary
pattern of a long is the 48 bits of its representation. The
binary patterns are used in connection with the operators add,
extract, and shift.
T_3.1.6.4 R_e_a_l_s_ are represented as 48-bits built-in floating point numbers. This
gives the following range of non-zero real values:
&_ 1.6"-617 abs(real) 1.6"616
The precision of real values correspond to 35 significant bits.
Thus one unit added to the last binary place will correspond to a
relative change of the number of between 6"-11 and 3"-11.
The type length of a real variable is 4 halfwords. The 3 first
halfwords are used for the number part and the last halfword for
exponent part of the real.
The binary pattern of a real consists of a 36-bits, 2"s comple-
ment, number part followed by a 12-bits, 2"s complement, exponent
part so that the real value is:
number*2**exponent.
The number is either 0 or in the range -1 _ number -0.5, 0.5 _
number 1. The exponent is in the range -2048 _ exponent _ 2047.
The exponent of 0.0 is -2048, but other exponents might be ob-
tained by the operator "add".
If r is a floating point zero with an exponent '-2048, the re-
lation r = 0 will be false because the operands are compared bit
by bit. The relations r _ 0 or r '_ 0 will both be true, however.
Operations like r + b cannot be expected to give b (see ref. 4).
T_ 3.1.7 R_e_a_l_s_ _u_s_e_d_ _a_s_ _s_e_m_i_-_l_o_n_g_ _i_n_t_e_g_e_r_s_
As there is neither built-in long multiplication nor built-in
&_ long division, programs using many of these operations on large
integers may be speeded up some what by representing them as real
variables.
This can be done with full accuracy as long as all results are
kept in the range
-2**35 = -34 359 738 368 _ real _ 34 359 738 367 = 2**35 - 1
If the results exceeds this range, the last bits of the semi-long
integer are lost. \f
A kind of integer division may be obtained by a real division fol-
lowed by a cut-off of decimals caused by the addition of a large
constant. For results in the range 0 _ result _ 2**34, this is
done as follows:
T_ roundconstant: = 2**34,
&_ result: = r1/r2 + roundconstant - roundconstant,
Safety against loss of accuracy may be obtained by scaling the
semilong integers so that loss of accuracy will cause a floating
point overflow. The scale factor f is chosen so that f*2**35 =
T_ 2**2048 and f*(-2**35) = -2**2048. This is fulfilled by f =
2**2013. Addition (i1 + i2) and multiplication (i1 * i2) with
check for loss of accuracy may be performed like this:
r1: = i1*f, r2: = i2*f,
&_ r1 + r2 r1/f*r2
T_ 3.2 F_u_n_c_t_i_o_n_ _d_e_s_i_g_n_a_t_o_r_s_
3.2.1 S_y_n_t_a_x_
&_ procedure identifier' ::= identifier'
T_ string literal'
expression'
array identifier'
actual parameter' ::= array field'
switch identifier'
procedure identifier'
zone identifier'
&_ zone array identifier'
T_ *
&_ letter string' ::= letter'0
T_parameter delimiter' ::= ,
&_ )letter string':(
T_ actual parameter list' ::= *
&_ actual parameter' parameter delimiter'actual parameter'0
1
actual parameter part' ::= (actual parameter list')0
T_ function designator' ::=
&_ procedure identifier'actual parameter part'
\f
T_ The parameter delimiter' known as "fat comma" defined by )let-
ter string':( may not contain compound symbols, to prevent code
&_ errors. Comment strings may not be used either.
T_
3.2.2 E_x_a_m_p_l_e_s_
sin (a - b)
J(v + s, n)
R
S(s - 5)Temperature:(T)Pressure:(P)
&_ write(out, :good morning:', d.ddddd', folks)
T_ 3.2.3 S_e_m_a_n_t_i_c_s_
Function designators define single numerical or logical values,
which result through the application of given sets of rules
&_ defined by a procedure declaration (cf. section 5.4 Procedure
Declarations) to fixed sets of actual parameters. The rules
governing specification of actual parameters are given in section
4.7 Procedure Statements. Not every procedure declaration defines
the value of a function designator.
T_
3.2.4 S_t_a_n_d_a_r_d_ _f_u_n_c_t_i_o_n_s_ The numerical standard functions of ALGOL 7
are listed below. They are described in detail in User>s Manual,
ref. 14.
arcsin cos random sin
arctan exp sgn sinh
&_ arg ln sign sqrt
T_ 3.2.5 T_r_a_n_s_f_e_r_ _f_u_n_c_t_i_o_n_s_
The operators add, extend, entier, extract, long, real, round and
string take care of type transfers.
T_ 3.3 A_r_i_t_h_m_e_t_i_c_ _e_x_p_r_e_s_s_i_o_n_s_
3.3.1 S_y_n_t_a_x_
adding operator' ::= +
&_ -
T_ *
multiplying operator' ::=/
//
&_ mod
T_ shift
pattern operator' ::= add
&_ extract
\f
T_ abs
entier
monadic operator' ::= round
extend
real
&_ string
long
T_ unsigned number'
variable'
1function designator'
primary' ::= monadic operator' (arithmetic expression')
0 real string primary'
&_ long string primary'
T_ factor'**
factor' ::= factor'pattern operator' primary'
&_ boolean basic' extract
T_ 1
term' ::= term'multiplying operator' factor'
&_ 0
T_simple arithmetic expression' ::=
11
simple arithmetic expression' adding operator' term'
&_ 00
if clause' ::= if boolean expression' then
case clause' ::= case arithmetic expression' of
T_arithmetic expression list' ::=*
&_ arithmetic expression' ,arithmetic expression'0
T_arithmetic expression' ::=
simple arithmetic expression'
if clause'simple arithmetic expression'elsearithmetic expression'
&_ case clause' (arithmetic expression list')
string primary' cf. 3.6.1
boolean basic' cf. 3.4.1
boolean expression' cf. 3.4.1
\f
T_ 3.3.2 E_x_a_m_p_l_e_s_
Primaries:
7.394"-8
sum
w(i+2,8)
cos(y+z*3)
(a-3/y+vu**8)
long(if b then :abc:' else dd.d0')
abs round ra(i)
entier cos(y+z)
Factors:
omega
round r shift (-6) add j
(a b) extract 1
sum ** cos (y+z*3)
&_ 7-394"-8**w (i+2,8) ** (a-3/y+vu**8)
T_ Terms:
U
&_ omega * sum**cos(y+z*3)/7.394"-8**w(i+2,8)**(a-3/y+vu**8)
T_ Simple arithmetic expression:
&_ U-Yu+omega*sum**cos(y+z*3)/7.394"-8**w(i+2,8)**(a-3/y+vu**8)
T_ Arithmetic expressions:
w * u - Q(S+Cu)**2
if q'0 then S+3 * Q/A else 2 * S+3 * Q
if a0 then U+V else if a * b=17 then U/V
else if k'y then V/U else 0
a * sin (omega * t)
0.57"12 * a(N * (N - 1)/2, 0)
(A * arctan(y) + Z) ** (7 + Q)
if q then n-1 else n
if a0 then A/B else if b=0 then B/A else z
case 1 + f of (i mod j, if b then r**j else i, case i of (j))
&_ if b then (case i of (j,r)) else case i of (1,5)
T_ 3.3.3 S_e_m_a_n_t_i_c_s_
An arithmetic expression is a rule for computing a numerical va-
lue. In the case of simple arithmetic expressions this value is
&_ obtained by executing the indicated arithmetic operations on the
actual numerical values of the primaries of the expression, as
explained in detail in Section 3.3.4 below. The actual numerical
value of a primary is obvious in the case of numbers. For varia-
bles it is the current value (assigned last in the dynamic sen-\f
se), and for function designators it is the value rising from the
computing rules defining the procedure (see Section 5.4.4 Values
of function designators) when applied to the current values of
the procedure parameters given in the expression. Finally, for
arithmetic expressions enclosed in parentheses the value must
through a recursive analysis be expressed in terms of the values
of primaries of the other three kinds.
I_f_
In the more general arithmetic expressions, which include i_f_ _c_l_a_u_-
s_e_s_, one out of several simple arithmetic expressions is selected
on the basis of the actual values of the boolean expressions (see
Section 3.4 Boolean expressions). This selection is made as fol-
lows: The boolean expressions of the if clauses are evaluated one
by one in sequence from left to right until one having the value
true is found. The value of the arithmetic expression is then the
value of the first arithmetic expression following this boolean.
If none of the boolean expressions has the value true, then the
value of the arithmetic expression is the value of the expression
following the final else.
C_a_s_e_
The expressions of an expression list in a case expression are
separated by commas and numbered 1, 2, 3,...
A_ _c_a_s_e_ _e_x_p_r_e_s_s_i_o_n_ is evaluated as follows: First, evaluate the
arithmetic expression and if necessary round it to an integer.
Next, select the list element corresponding to the result. If no
such list element exists, the run is terminated. Evaluate the
selected expression and take the result as the value of the case-
expression.
The order of evaluation of primaries within an expression is not
defined. If different orders of evaluation would produce diffe-
rent results, due to the action of side effects of function de-
signators, then the program is undefined.
In evaluating an arithmetic expression, it is understood that all
the primaries within that expression are evaluated, except those
within any arithmetic expression that is governed by an if clause
but not selected by it. In the special case where an exit is made
from a function designator by means of a goto statement (see sec-
tion 5.4.4), the evaluation of the expression is abandoned, when
the goto statement is executed.
\f
T_ 3.3.4 O_p_e_r_a_t_o_r_s_ _a_n_d_ _t_y_p_e_s_
Apart from the boolean expressions of if clauses, the constitu-
ents of simple arithmetic expressions must be of real, long or
&_integer types (see Section 5.1 Type declarations). The meaning of
the basic operators and the types of the expressions to which
they lead are given by the following rules:
T_ 3.3.4.1 T_h_e_ _o_p_e_r_a_t_o_r_s_ +, -, and * have the conventional meaning (addition,
subtraction, and multiplication). The type of the expression will
&_ be integer if both of the operands are of integer type. The type
is real if at least one of the operands is of real type.
Otherwise the type is long.
T_ 3.3.4.2 T_h_e_ _o_p_e_r_a_t_i_o_n_s_ term / factor and term // factor both denote di-
vision. The operations are undefined if the factor has the fac-
tor value zero, but are otherwise to be understood as a multipli-
&_ cation of the term by the reciprocal of the factor with due re-
T_ gard to the rules of precedence (see Section 3.3.5). Thus for
example
a/b * 7/(p - q) * v/s
means
((((a * (bUU-1DD)) * 7) * ((p - q)UU-1DD)) * v) * (sUU-1DD).
The operator / is defined for all nine combinations of real,
long, and integer and will yield results of real type in any
&_ case.
The operator // is defined only for operands of integer or long
type. The result is integer if both operands are integer and long
otherwise.
T_ The result can be defined by the function:
long procedure div (a,b);
value a,b;
long a,b;
if b = 0 then
begin
if spilltest then div:=a
else alarm (:integer:')
end
else
begin long q,r;
q:=0, r:=abs a;
for r:=r - abs b while r'=0 do q:=q+1;
div:= if a0 == b'0 then -q else q
&_ end;
\f
If both operands are integer, an equivalent algorithm where all
long specifications and declarations are replaced by integer spe-
cifications and declarations, must be used as definition.
T_ 3.3.4.2.1 T_h_e_ _o_p_e_r_a_t_i_o_n_ term' mod factor' is defined where // is defined,
&_and yields values of the same types as //. For long resulting
values, the result may be defined by the function:
T_ long procedure modulus (a,b);
value a,b;
long a,b;
&_ modulus:= a - div(a,b)*b;
3.3.4.3 T_h_e_ _o_p_e_r_a_t_i_o_n_ factor'**primary' denotes exponentation where the
factor is the base and the primary is the exponent. Thus for
example
2**n**k means (2UUUnDDD)UUUkDDD
while
2**(n**m) means 2UU(nUUmDD)DD
The result of an exponentation is always real. The precision of
the exponentation is explained in ref. 14.
T_ 3.3.4.4 T_y_p_e_ _o_f_ _a_ _c_o_n_d_i_t_i_o_n_a_l_ _e_x_p_r_e_s_s_i_o_n_.
The result of
if clause'simple arithmetic expression' else
arithmetic expression'
&_ is of type integer if both expressions are of type integer, of
type real if at least one expression is of type real, and of type
long otherwise.
The result of
case clause'(arithmetic expression list')
is of type integer if all expressions in the list are of type
integer, of type real if at least one expression is of type real,
and of type long otherwise.
3.3.4.5 T_y_p_e_s_ _o_f_ _t_h_e_ _m_o_n_a_d_i_c_ _o_p_e_r_a_t_o_r_s_ _a_n_d_ _t_h_e_ _p_a_t_t_e_r_n_ _o_p_e_r_a_t_o_r_s_
Pattern operators: can be used in arithmetic and boolean
expressions.
add This dyadic pattern operator will perform a binary ad-
dition. The type of the left hand operand will yield
the type of the result.
extract This pattern operator extracts a number of the\f
rightmost bits. The result is of type integer.
shift This pattern operator will perform a logical shift of
the left hand operand.
Monadic operators:
abs This operator yields the absolute value of integer,
long or real expressions.
The following monadic operators are the transfer functions:
extend This operator converts an integer expression into a
type long.
entier This operator transfers a real expression to the
largest integer not greater than the expression.
long This operator changes the type of a string or real
expression into type long.
real This operator changes the type of a string or long
expression into type real.
round This operator rounds the value of a real or long
expression to the nearest integer.
string This operator changes type of real or long expression
into type string.
Further description see Algol 7 User"s Manual ref. 14.
T_ 3.3.5 P_r_e_c_e_d_e_n_c_e_ _o_f_ _o_p_e_r_a_t_o_r_s_
Function calls in an expression may cause "side-effects", but the
&_ result will correspond to a left to right evaluation of the ex-
pression, so that side-effects may only influence variables to
the right of the function call.
T_ 3.3.5.1 A_c_c_o_r_d_i_n_g_ _t_o_ _t_h_e_ _s_y_n_t_a_x_ _g_i_v_e_n_ in section 3.3.1 the following
rules of precedence hold:
first: abs entier real round long extend string
second: ** add extract shift
third: * / // mod
&_ fourth: + - \f
T_ 3.3.5.2 T_h_e_ _e_x_p_r_e_s_s_i_o_n_ between a left parenthesis and the matching right
parenthesis is evaluated by itself and this value is used in sub-
&_ sequent calculations. Consequently the desired order of execution
of operations within an expression can always be arranged by ap-
propriate positioning of parentheses.
T_ 3.3.6 A_r_i_t_h_m_e_t_i_c_ _o_f_ _r_e_a_l_,_ _l_o_n_g_,_ _a_n_d_ _i_n_t_e_g_e_r_ _q_u_a_n_t_i_t_i_e_s_.
The operations + - * / ** (for integer, long or real exponents)
are performed by the built in floating point operations whenever
&_the result is of type real, and by the fixed point operations
whenever the result is of type integer. Whenever the result is of
type long, + and - are performed by the built in double length
operations, whereas the operation * is performed by a subrou-
tine.
The operations // and mod are performed by the built in fixed
point division whenever the result is of type integer, and by a
subroutine whenever the result is of type long.
When necessary integer operands are floated by means of the built
in float operation or converted to a long by extension of the
sign. Conversion of operands of type long to type real is per-
formed by a subroutine.
The range of values of type real and integer is given in 3.1.6.
The action when the range of reals is exceeded, is controlled at
run time by means of the two standard integer variables "over-
flows" and "underflows" (cf. ref. 14). The action when the range
of integers or longs is exceeded, is determined at translation
time by means of the translation parameter "spill" (cf.ref. 14).
(In the RC 4000 and RC 6000, the precision of real arithmetic may
be decreased from 36 bits to 33 bits. This option is controlled
at run time by means of the standard procedure "system". The re-
sults of the numerical standard functions are distorted corre-
spondingly when the low precision is selected.)
\f
T_ 3.4 B_o_o_l_e_a_n_ _e_x_p_r_e_s_s_i_o_n_s_
3.4.1 S_y_n_t_a_x_
=
relational operator' ::= =
'=
'
&_'
T_and' ::= and
&_ &
T_or' ::= or
&_ !
T_ relation' ::=
simple arithmetic expression'relational operator'
&_ simple arithmetic expression'
T_boolean pattern operator' ::= add
&_ shift
T_boolean basic' ::=
logical value'
variable'
function designator'
boolean basic'boolean pattern operator'primary'
&_ (boolean expression')
T_ boolean primary' ::= boolean basic'
&_ relation'
T_ 1
&_ boolean secondary' ::= -, 0 boolean primary'
T_ 1
&_ boolean factor' ::= boolean factor'and' 0 boolean secondary'
T_ 1
&_ boolean term' ::= boolean term'or' 0 boolean factor'
T_ 1
&_ implication' ::= implication' =' 0 boolean term'
T_ 1
&_ simple boolean' ::= simple boolean'== 0 implication'
\f
T_boolean expression list' ::= *
&_ boolean expression' ,boolean expression list'0
T_ boolean expression' ::=
simple boolean'
if clause'simple boolean' else boolean expression'
&_ case clause'(boolean expression list')
T_ 3.4.2 E_x_a_m_p_l_e_s_
if b add 1 shift 3 then (case i of (true, b or c)) else
case j of ((u=v) shift 1, false)
x = -2
Y ' V or z q
a + b ' -5 and z - d ' q **2
p or q and x ' y
g == -, a and b and -,c or d or e =' -,f
if k 1 then s ' w else h= c
&_ if if if a then b else c then d else f then g else h k
T_3.4.3 S_e_m_a_n_t_i_c_s_
A boolean expression is a rule for computing a logical value.
The principles of evaluation are entirely analogous to those
&_ given for arithmetic expressions in Section 3.3.3.
T_ 3.4.4 T_y_p_e_s_
Variables and function designators entered as boolean primaries
must be declared boolean (see Section 5.1 Type declarations and
&_ Section 5.4.4 Values of function designators).
T_ 3.4.5 O_p_e_r_a_t_o_r_s_
The relational operators ,=,=,'=,', ' have the meaning: less
than, less than or equal to, equal to, greater than or equal to,
&_ greater than, not equal to, respectively. A relation take on the
value true whenever the corresponding relation is satisfied for
the expressions involved, otherwise false.
The meaning of the logical operators -, (not), and', or',
=' (implies), == (equivalent), is given by the following function
table:
\f
T_ b1 false false true true
b_2_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _f_a_l_s_e_ _ _ _ _t_r_u_e_ _ _ _ _ _f_a_l_s_e_ _ _ _ _t_r_u_e_ _
-, b1 true true false false
b1 and b2 false false false true
b1 or b2 false true true true
b1 =' b2 true true false true
&_ b1 == b2 true false false true
T_ 3.4.6 P_r_e_c_e_d_e_n_c_e_ _o_f_ _o_p_e_r_a_t_o_r_s_
The sequence of operations within an expression is generally
evaluated from left to right, with the following additional
&_rules:
T_ 3.4.6.1 A_c_c_o_r_d_i_n_g_ _t_o_ _t_h_e_ _s_y_n_t_a_x_ given in Section 3.4.1 the following
rules of precedence hold:
first: arithmetic expressions and pattern operators according
to Section 3.3.5
second: ,,=,=,'=,'
third: -,
fourth: &, and (both notations equivalent)
fifth: !, or (both notations equivalent)
sixth: ='
&_ seventh: ==
T_ 3.4.6.2 T_h_e_ _u_s_e_ _o_f_ _p_a_r_e_n_t_h_e_s_e_s_ will be interpreted in the sense given in
&_ Section 3.3.5.2.
T_ 3.4.7 A_r_i_t_h_m_e_t_i_c_ _o_f_ _b_o_o_l_e_a_n_ _q_u_a_n_t_i_t_i_e_s_
The representation of booleans and some rules for boolean arith-
metic is given in 3.1.6. Here, we add the rules for relational
&_ operators:
T_ ,=,'=,' are in most cases executed as a subtraction (floating
point or fixed point) of the two operands. Thus, you
&_ must be prepared for overflow, underflow, or spill.
T_ =,' are always performed as a bit by bit comparison of the
two operands. This may for instance be utilised to
compare two text strings packed into real variables
&_ without risk of overflow.
\f
T_ 3.5 D_e_s_i_g_n_a_t_i_o_n_a_l_ _e_x_p_r_e_s_s_i_o_n_s_
3.5.1 S_y_n_t_a_x_
label' ::= identifier'
switch identifier' ::= identifier'
switch designator' ::=
&_switch identifier'(subscript expression')
T_ simple designational expression' ::= label'
switch designator'
&_ (designational expression')
T_ designational expression list' ::=*
&_ designational expression' ,designational expression' 0
T_ designational expression' ::=
simple designational expression'
if clause'simple designational expression'elsedesignational expression'
&_ case clause'(designational expression list')
T_ 3.5.2 E_x_a_m_p_l_e_s_
L17
p9
Choose(n-1)
Town(if y 0 then N else N+1)
if Ab c then L17
else q (if w =0 then 2 else n)
&_ case p+q of (L17, P13, Choose(n-1))
T_ 3.5.3 S_e_m_a_n_t_i_c_s_
A designational expression is a rule for obtaining a label of a
statement (see Section 4 Statements). Again the principle of the
&_ evaluation is entirely analogous to that of arithmetic expressions
(see Section 3.3.3). In the general case the booleanexpressions
of the if clauses will select a simple designational expression.
If this is a label the desired result is already found. A switch
designator refers to the corresponding switch declaration (see
Section 5.3 Switch declarations) and by the actual numerical va-
lue of its subscript expression selects one of the designational
expressions listed in the switch declaration by counting these
from left to right from 1 and up. Since the designational expres-
sion thus selected may again be a switch designator this evalua-
tion is obviously a recursive process.
T_ 3.5.4 T_h_e_ _s_u_b_s_c_r_i_p_t_ _e_x_p_r_e_s_s_i_o_n_
The evaluation of the subscript expression is analogous to that
&_ of subscripted variables (see Section 3.1.4.2). The value of a
switch designator is defined only if the subscript expression\f
assumes one of the positive values 1,2,3...,n, where n is the
number of entries in the switch list.
T_ 3.5.5 S_w_i_t_c_h_ _v_e_r_s_u_s_ _c_a_s_e_ _s_t_a_t_e_m_e_n_t_
It is recommended to use the case statements instead of "goto
sw(i)". Case statements are much faster and may give a clearer
&_ program.
T_ 3.6 S_t_r_i_n_g_ _e_x_p_r_e_s_s_i_o_n_s_
3.6.1 S_y_n_t_a_x_
&_ formal string' ::= identifier'
T_
formal string'
string literal'
string primary' ::= string arithmetic expression'
(string expression')
&_ string primary' add primary'
T_ string expression list' ::= *
&_ string expression', 0 string expression'
T_ string expression' ::=
string primary'
if clause'string primary' else string expression'
&_ case clause'(string expression list')
T_ 3.6.2 E_x_a_m_p_l_e_s_
if b then :ok:' else :error:'
case i of (:first:',:second',string ra(increase(j)))
if b then (case i of (string r,fs))
&_ else case i of(:ab:',d.dd')
3.6.3 S_e_m_a_n_t_i_c_s_
A string expression is a rule for computing a string value. The
principles of evaluation are analogous to the evaluation of an
arithmetic expression. The monadic operator "string" changes the
type of a real or long expression into type string. The value of
string real' or string long' has the same bit pattern as the
value of the operand (see below).
String expressions are used as actual parameters and as arguments
of the operator "real".
\f
T_ The value of a string expression is
a short text string (a literal text string of at most 5
characters, for example :abcde:'),
a long text string (a literal text string of more than
5 characters, for example :result:'),
a layout string (for example dd.dd"+d'), or
a text portion (6 characters none of which are Nulls.
This cannot occur as a literal text, but
may be obtained by the operators
"string" or "add", for example
&_ :abcde:'add 92).
T_ 3.6.4 T_y_p_e_s_
The argument of the operator "string" must be of type real or
long. A formal string must be a formal parameter specified as
&_ string.
T_ 3.6.5 B_i_n_a_r_y_ _p_a_t_t_e_r_n_
The binary pattern of a string value is 48 bits with the values
&_ given below.
T_ 3.6.5.1 T_e_x_t_ _p_o_r_t_i_o_n_ _a_n_d_ _s_h_o_r_t_ _t_e_x_t_ _s_t_r_i_n_g_. The characters of the text
string (omitting the string quotes) are represented as their in-
ternal value (see 2.0.1) and packed as 8-bit bytes from left to
&_ right. The 48 bits are filled up to the right with zeroes.
T_ 3.6.5.2 L_o_n_g_ _t_e_x_t_ _s_t_r_i_n_g_. The text strings are stored in portions of 48
&_ bits (two words). These words may contain
T_long text string reference:
word 1 (24 bits): segm shift 12 add rel
word 2 (24 bits): 1 followed by some undefined bits
character portion:
word 1: char N+3 shift 16 add char N+4 shift 8 add char N+5
word 2: char N shift 16 add char N+1 shift 8 add char N+2
or
&_short text string.
The long text string is referenced with a long text string refe-
rence specifying on which segment (segm) and at which relator
(rel) the text starts.
The characters of the text string are stored as text portions on
the backing storage area which is occupied by the algol program.\f
The first text portion representing the first 6 characters is
found on segment "segm" word rel//2-1 and rel//2 (the 256 words
of a segment are numbered 0, 1, 2, ...). The next text portions
are found in word rel//2-3 and rel//2-2 and so on, until 48 bits
representing a new long text string are found (which specifies
the continuation of the string on a new segment) or until 48 bits
representing a short text string are found (signaling the string
end).
T_3.6.5.3L_a_y_o_u_t_ _s_t_r_i_n_g_. The first 24 bits represent the spaces of the lay-
out as follows:
First, a 1 followed by a 1 for each leading space of the layout.
&_ Second, one 0.
The following bits correspond to the digit positions of the num-
ber part (z, f, d, and 0). A bit is 1 if the corresponding digit
position is followed by a space, otherwise 0.
T_ The last 24 bits contain:
bit 0 0
bit 1-5 b = number of significant digits (z, b, f, and d).
bit 6-9 h = number of digit positions before the point.
bit 10-13 d = number of digit positions after the point.
bit 14-15 pn = first letter of number part (z=10, f=01, d=00,
b=11).
bit 16-17 fn = sign of number part (+ =10, - =01, no sign =00).
bit 18-19 s = number of digits in exponent.
bit 20-21 pe = first letter of exponent part (z=10, f=01, d=00).
&_ bit 22-23 fe = sign of exponent part coded as fn.
T_ 3.6.5.4 R_e_f_e_r_e_n_c_e_ _o_f_ _s_t_r_i_n_g_s_
When a standard procedure references a string parameter and
obtains a text portion as the result, it will accept these 6
&_ characters as the first part of the string and reference the
parameter again and again to obtain the next text portions. When
a short or a long text string is obtained, the string end is met
(null character). This rule implies that the string parameter
must have side-effects to supply new text portions when it is
referenced repeatedly. The standard procedure "increase" assists
you with this tasks as explained in the following example.
\f
T_Example:
Let the real array ra(1:n) hold a sequence of text
portions terminated by a null character.
This variable text may be used as a string parameter in
this way, for instance:
i:= 1; write(out,string ra(increase(i)));
Write will reference the second parameter, which in
turn calls increase(i) and yields the value of ra(1).
At the same time i becomes 2. Write will print the text
portion held in ra(2) and if it does not contain a null
character, write will reference the second parameter
again, and so on until the null character signals the
&_ end of the text.
T_3.7Z_o_n_e_ _e_x_p_r_e_s_s_i_o_n_s_
3.7.1 S_y_n_t_a_x_
&_ zone expression' cf. 3.1.1
T_ 3.7.2 E_x_a_m_p_l_e_s_
in
polyfase (p)
&_ polyfase (input(i))
T_ 3.7.3 S_e_m_a_n_t_i_c_s_
The value of a zone expression is a zone. Zone expressions are
&_ used as actual parameters.
The arithmetic expression is evaluated as a subscript expression.
It selects a zone from the zone array. The subscript must obey
1 _ subscript _ number of zones declared in the array.
\f
F_ 4. S_t_a_t_e_m_e_n_t_s_
The units of operation within the language are called statements.
They will normally by executed consecutively as written. However,
this sequence of operations may be broken by go to statements,
which define their successor explicitly, shortened by conditional
statements, which may cause certain statements to be skipped, and
lengthened by repetitive statements which cause certain statements
to be repeated.
In order to make it possible to define a specific dynamic succes-
sion, statements may be provided with labels.
Since sequences of statements may be grouped together into com-
pound statements and blocks the definition of statement must ne-
cessarily be recursive. Also declarations are supposed to be al-
ready defined as they are used in syntactic definition of state-
ments.
T_ 4.1 C_o_m_p_o_u_n_d_ _s_t_a_t_e_m_e_n_t_s_ _a_n_d_ _b_l_o_c_k_s_
4.1.1 S_y_n_t_a_x_
assignment statement'
1goto statement'
basic statement' ::= label': dummy statement'
0procedure statement'
&_ context statement' *)
T_ basic statement'
unconditional statement' ::= compound statement'
&_ block'
T_ unconditional statement'
statement' ::= conditional statement'
&_ repetitive statement'
T_ end
&_ compound tail' ::=statement' ;compound tail'
begin
*
T_ simple block head' ::= simple block head' ;simple declaration'1
&_
*) NOTE: a context statement' is only allowed within a context
block. \f
T_ context block head' ::= *
&_ begin context declaration' ;context variable declaration' 0
context block' ::= context block head';compound tail'
T_ simple block head'
&_ block head' ::= context block head'
unlabelled compound' ::= begin compound tail'
T_ compound statement' ::=
1 unlabelled compound'
&_ label': 0 compound statement'
T_ 1block head';compound tail'
&_ block' ::= label': 0 block'
T_ block'
program' ::= compound statement'
&_ external procedure declaration';end
This syntax may be illustrated as follows: Denoting arbitrary
statements, declarations, and labels, by the letters S, D, and L,
respectively, the basic syntactic units take the forms:
T_ Compound statement:
L:L:...begin S;S;...S;S end
Block:
&_ L:L:...begin D;D;...D;S;S;...S;S end
It should be kept in mind that each of the statements S may again be a
complete compound statement or block.
T_ 4.1.2 E_x_a_m_p_l_e_s_
Basic statements:
a:= p+q
goto Naples
&_ START:CONTINUE: W:= 7.993
\f
T_ Compound statement:
begin x: = 0;
for y:= 1 step 1 until n do x:= x + A(y);
if x ' q then goto STOP
else if x ' w - 2 then goto S;
Aw: St: W:= x + bob
&_ end
T_ Block:
Q: begin integer i,k, real w;
for i:= 1 step 1 until m do
for k:= i + 1 step 1 until m do
begin w:= A(i,k);
A(i,k) := A(k,i);
A(k,i) := w
end for i and k
&_ end block Q
T_ Context block:
R: begin context (i,r,mode);
integer q1,q2;real w;
if i = type 1 then
w:= B(i,1)
else
w:= B(i,2)
&_ end block R
T_ Program:
external procedure X(p);
integer p;
p:= p + 1;
&_ end external
T_ 4.1.3 S_e_m_a_n_t_i_c_s_
Every block automatically introduces a new level of nomenclature.
This is realized as follows: Any identifier occurring within the
&_ block may through a suitable declaration (see Section 5 Declara-
tions) be specified to be local to the block in question. This
means (a) that the entity represented by this identifier inside
the block has no existence outside it and (b) that any entity
represented by this identifier outside the block is completely
inaccessible inside the block.
Identifiers (except those representing labels) occuring within a
block and not being declared to this block will be non-local to\f
it, i.e. will represent the same entity inside the block and in
the level immediately outside it. A label separated by a colon
from a statement, i.e. labelling that statement, behaves as
though declared in the head of the smallest embracing block, i.e.
the smallest block whose brackets "begin" and "end" enclose that
statement.
A label is said to be i_m_p_l_i_c_i_t_l_y_ _d_e_c_l_a_r_e_d_ in this block head, as
distinct from the explicit declaration of all other local identi-
fiers. In this context a procedure body, or the statement follow-
ing a for clause, must be considered as if it were enclosed by
begin and end and treated as a block, this block being nested
within the fictive block of Section 4.7.3.1 in the case of a pro-
cedure with parameters by value.
A label that is not within any block of the program (nor within a
procedure body, or the statement following a for clause) is impli-
citly declared in the head of the environmental block.
Since a statement of a block may again itself be a block, the
concepts local and non-local to a block must be understood re-
cursively. Thus an identifier which is non-local to a block A,
may or may not be non-local to the block B in which A is a state-
ment.
T_ 4.2 A_s_s_i_g_n_m_e_n_t_ _s_t_a_t_e_m_e_n_t_s_
4.2.1 S_y_n_t_a_x_
destination' ::= variable'
&_ procedure identifier'
T_left part' ::= destination' :=
*
&_left part list' ::= left part' 1
T_ assignment statement' ::= left part list'arithmetic expression'
&_ left part list'boolean expression'
T_ 4.2.2 E_x_a_m_p_l_e_s_
s:= p(0):= n:= n + 1 + s
n:= n + 1
A:= B/C - v - q * S
S(v,k + 2):= 3 - arctan(s * zeta)
&_ V:= Q ' Y and Z \f
T_ 4.2.3 S_e_m_a_n_t_i_c_s_
Assignment statements serve for assigning the value of an expres-
&_ sion to one or several destinations.
Assignment to a procedure identifier may only occur within the
body of a procedure defining the value of the function designator
denoted by that identifier (see Section 5.4.4).
If assignment is made to a subscripted variable, the values of
all the subscripts must lie within the appropriate subscript
bounds.
The location of a zone buffer element designated by a record
variable is not influenced by expressions to the right of the
record variable, even if these change the position of the record
within the zone buffer.
The l_o_c_a_t_i_o_n_ of a variable is an absolute address in the RC 8000.
The assignment process takes place in three steps as follows.
T_ 4.2.3.1 T_h_e_ _l_o_c_a_t_i_o_n_ of all variables, including subscripted variables,
record variables, and simple fields, occuring in the left part
&_ are evaluated from left to right.
T_ 4.2.3.2 T_h_e_ _e_x_p_r_e_s_s_i_o_n_ of the statement is evaluated.
4.2.3.3 T_h_e_ _v_a_l_u_e_ _o_f_ _t_h_e_ _e_x_p_r_e_s_s_i_o_n_ is assigned to all the left part va-
riables with locations as evaluated in step 4.2.3.1 in sequence
&_ from right to left.
T_ 4.2.4 T_y_p_e_s_
The type associated with all destinations of a left part list
&_ must be the same.
If this type is boolean, the expression must likewise be boolean.
If the type is real, long, or integer, the expression must be
arithmetic.
If the type of the arithmetic expression differs from that asso-
ciated with the destinations, an appropriate transfer function is
automatically performed. For transfer from real to long or inte-
ger type the transfer function yields a result which is the lar-
gest integral quantity not exceeding E + 0.5 in the mathematical
sence (i.e. without rounding error) where E is the value of the
expression. It should be noted that E, being of real type, is de-\f
fined with only finite accuracy (see Section 3.3.6).
The type associated with a procedure identifier is given by the
declarator which appears as the first symbol of the corresponding
procedure declaration (see Section 5.4.4).
Field variables may be used as variables of type integer.
The conversion of a real value to an integer or long and the con-
version from a long value to an integer are performed so that
spill alarm (see User"s Manual ref. 14) may occur.
T_ 4.3 G_o_t_o_ _s_t_a_t_e_m_e_n_t_s_
4.3.1 S_y_n_t_a_x_
&_ goto statement' ::= goto designational expression'
T_ 4.3.2 E_x_a_m_p_l_e_s_
goto L8
goto exit(n + 1)
goto Town(if y 0 then N else N + 1)
goto if Ab c then L17
else q(if w 0 then 2 else n)
&_ goto case p + q of (L17, p13, choose(n-1))
T_ 4.3.3 S_e_m_a_n_t_i_c_s_
A goto statement interrupts the normal sequence of operations, by
defining its successor explicitly by the value of a designational
expression. Thus the next statement to be executed will be the
&_ one having this value as its label.
T_ 4.3.4 R_e_s_t_r_i_c_t_i_o_n_
Since labels are inherently local, no goto statement can lead
from outside into a block. A goto statement may, however, lead
&_ from outside into a compound statement.
T_ 4.3.5 G_o_t_o_ _a_n_ _u_n_d_e_f_i_n_e_d_ _s_w_i_t_c_h_ _d_e_s_i_g_n_a_t_o_r_
A goto statement will terminate the program with an alarm if the
designational expression is a switch designator whose value is
&_ undefined.
T_ 4.4 D_u_m_m_y_ _s_t_a_t_e_m_e_n_t_s_
4.4.1 S_y_n_t_a_x_
&_ dummy statement' ::= empty' \f
T_ 4.4.2 E_x_a_m_p_l_e_s_
L:
&_ begin statements;John:end
T_ 4.4.3 S_e_m_a_n_t_i_c_s_
A dummy statement executes no operation. It may serve to place a
&_ label.
T_ 4.5 C_o_n_d_i_t_i_o_n_a_l_ _s_t_a_t_e_m_e_n_t_s_
4.5.1 S_y_n_t_a_x_
case statement' ::= case clause' begin statement set' end
&_ if statement' ::= if clause'unconditional statement'
T_ conditional if statement' ::=
* if statement'
label': 0 if clause' else statement'
&_ if clause'rep. statement'
T_
conditional if statement'
conditional statement' ::= *
&_ label': 0 case statement'
T_*
&_ statement set' ::= statement' ;statement' 0
T_ case clause' cf. 3.3.1
if clause' cf. 3.3.1
&_ unconditional statement' cf. 4.1.1
repetitive statement' cf. 4.6.0.1
T_ 4.5.2 E_x_a_m_p_l_e_s_
if x ' 0 then n:= n + 1
if v ' u then V: q:= n + m else goto R
if s 0 or P = Q then
AA: begin if q v then a:= v/s
else y:= 2 * a
end
else if v ' s then a:= v - q
&_ else if v ' s - 1 then goto S
\f
T_ 4.5.3 S_e_m_a_n_t_i_c_s_
Conditional statements cause certain statements to be executed or
skipped depending on the running values of specified boolean ex-
&_ pressions or arithmetic expressions.
T_ 4.5.3.1 I_f_ _s_t_a_t_e_m_e_n_t_. An if statement is of the form
if B then Su
where B is a boolean expression and Su is an unconditional state-
ment. In execution, B is evaluated; if the result is true, Su is
&_ executed; if the result is false, Su is not executed.
If Su contains a label, and a goto statement leads to the label,
then B is not evaluated, and the computation continues with
execution of the labelled statement.
T_ 4.5.3.2 C_o_n_d_i_t_i_o_n_a_l_ _i_f_ _S_t_a_t_e_m_e_n_t_. Three forms of unlabelled conditional
statement exist, namely:
if B then Su
if B then Sfor
if B then Su else S
where Su is an unconditional statement, Sfor is a for statement
&_ and S is a statement.
The meaning of the first form is given in Section 4.5.3.1.
T_ The second form is equivalent to
&_ if B then begin Sfor end
T_ The third form is equivalent to
begin
if B then begin Su; goto localL end;
S;
localL: end
&_ Where localL is an anonymous local label.
T_ 4.5.4 G_o_t_o_ _i_n_t_o_ _a_ _c_o_n_d_i_t_i_o_n_a_l_ _i_f_ _s_t_a_t_e_m_e_n_t_
The effect of a goto statement leading into a conditional
statement follows directly from the above explanation of the
&_ execution of a conditional statement.
\f
T_ 4.5.5 C_a_s_e_ _s_t_a_t_e_m_e_n_t_
4.5.5.1 S_e_m_a_n_t_i_c_
The case statement
case i of
begin S1; S2;...; SN end
where S1;...SN are statements
is equivalent to
switch SWIT := SWIT1, SWIT2,...SWITN
goto SWIT(i);
SWIT1: S1; goto STOP;
.
.
.
SWIT2: S2; goto STOP;
SWITN: SN;
&_ STOP:
The statements of the statement set are separated by semicolons
and numbered 1, 2, 3....
A case construction is executed as follows: First, evaluate the
arithmetic expression and if necessary round it to an integer.
Next, select the set element corresponding to the result. If no
such set element exists, the run is terminated. Execute the se-
lected statement and continue the execution after the complete
case-statement (provided that a goto was not executed).
T_ 4.5.5.2 E_x_a_m_p_l_e_
case i of
begin
a:= p+1;
begin
q:=p;
r:=q+1
end;
p:=q
&_ end
\f
T_ 4.6 R_e_p_e_t_i_t_i_v_e_ _s_t_a_t_e_m_e_n_t_s_
4.6.0.1 S_y_n_t_a_x_
for statement'
repetitive statement' ::= repeat statement'
&_ while statement'
T_4.6.0.2F_o_r_ _s_t_a_t_e_m_e_n_t_s_
4.6.1 S_y_n_t_a_x_
for list element' ::=
arithmetic expression'
arithm. express.'steparithm. express.'untilarithm. express'.
&_ arithmetic expression'whileboolean expression'
T_ *
&_ for list' ::= for list element' ,for list element'0
for clause' ::= for variable identifier' := for list' do
T_ 1
&_ for statement' ::= label': 0 for clause'statement'
T_ 4.6.2 E_x_a_m_p_l_e_s_
for q:= 1 step s until n do A(q):= B(q)
for k:= 1, V1 * 2 while V1 N do
for j:= I + G, L, 1 step 1 until N, C + D do
&_ A(k,j):= B(k,j)
4.6.3 S_e_m_a_n_t_i_c_s_
A for clause causes the statement S which it precedes to be re-
peatedly executed zero or more times. In addition it performs a
sequence of assignments to its controlled variable, which must be
a simple variable of real, long, or integer type or a field vari-
able. The process may be visualized by means of the following
picture:
T_ - - - - - - - - - - -
Initialize ; test ; statement S ; advance ; successor
- - - - - - - - - - - - - - - - -
&_for list exhausted
In this picture the word initialize means: perform the first
assignment of the for clause. Advance means: perform the next
assignment of the for clause. Test determines if the last as-
signment has been done. If so the execution continues with the
successor of the for statement. If not the statement following\f
the for clause is executed.
4.6.4 T_h_e_ _f_o_r_ _l_i_s_t_ _e_l_e_m_e_n_t_s_
The for list gives a rule for obtaining the values which are con-
secutively assigned to the controlled variable. This sequence of
values is obtained from the for list elements by taking these one
by one in the order in which they are written.
The sequence of values generated by each of the three species of
for list elements and the corresponding execution of the state-
ment S are given by the following rules:
T_ 4.6.4.1 A_r_i_t_h_m_e_t_i_c_ _e_x_p_r_e_s_s_i_o_n_ _e_l_e_m_e_n_t_
If X is an arithmetic expression then
for V := X do S
is equivalent to
begin
V := X;S
end
&_ where S is treated as if it were a block (see Section 4.3.1)
T_ 4.6.4.2 S_t_e_p_-_u_n_t_i_l_ _e_l_e_m_e_n_t_
If A, B and C are arithmetic expressions and V the controlled
variable then
A step B until C do S
is equivalent to
V:= A; localB:= B;
L1: if (V-C)*localB ' 0 then goto Element _exhausted;
S;
localB:= B; V:= V + localB;
&_ goto L1;
Where localB is an anonymous variable and Element _exhausted is
the end of this step-until-element.
T_ 4.6.4.3 W_h_i_l_e_ _e_l_e_m_e_n_t_
If E is an arithmetic expression, F a boolean expression and V the
controlled variable then
E while F do S
is equivalent to
L3:V:=E;
if -, F then goto Element _exhaused;
S;
goto L3;
&_ where the notation is the same as in 4.6.4.2 above. \f
4.6.5 T_h_e_ _v_a_l_u_e_ _o_f_ _t_h_e_ _c_o_n_t_r_o_l_l_e_d_ _v_a_r_i_a_b_l_e_ _u_p_o_n_ _e_x_i_t_.
Upon exit from a for statement, the value of the controlled
variable is defined by the algorithms in 4.6.4.2, 4.6.4.1, and
4.6.4.3 above.
4.6.6 G_o_t_o_ _l_e_a_d_i_n_g_ _i_n_t_o_ _a_ _f_o_r_ _s_t_a_t_e_m_e_n_t_.
Any occurrence outside a for statement of a label which labels a
statement inside the for statement is forbidden.
T_ 4.6.7 R_e_p_e_a_t_ _s_t_a_t_e_m_e_n_t_
4.6.8 S_y_n_t_a_x_
repeat statement' ::=
&_ repeat statement set'until boolean expression'
T_ 4.6.9 E_x_a_m_p_l_e_s_
repeat
a:= a+1;
sum:= sum+a
until a ' 99
&_ repeat AP(3,4,i) until i=0
T_ 4.6.10 S_e_m_a_n_t_i_c_
The statement
repeat S1; S2;...;SN until boo
is equivalent to the ALGOL construction:
for i:= i, i while -,boodo
begin
S1; S2;...;SN;
end
&_Nesting of repeat statements is allowed.
T_ 4.6.11 W_h_i_l_e_ _s_t_a_t_e_m_e_n_t_
4.6.12 S_y_n_t_a_x_
while statement' ::=
&_ while boolean expression' do statement'
\f
T_ 4.6.13 E_x_a_m_p_l_e_s_
while a'b do a:=b
while A(i) do
begin
a(i,j):=5;
a(j,i):=7
&_ end
T_ 4.6.14 S_e_m_a_n_t_i_c_s_
The statement
while boo do S
is equivalent to the ALGOL construction:
for i:= i while boo do
S
&_ Nesting of while statements is allowed.
T_4.7 P_r_o_c_e_d_u_r_e_ _s_t_a_t_e_m_e_n_t_s_
4.7.1 S_y_n_t_a_x_
procedure statement' ::=
&_ procedure identifier'actual parameter part'
actual parameter part' cf. 3.2.1
T_ 4.7.2 E_x_a_m_p_l_e_s_
Transpose (W, v+1)
Spur (A)Order:(7)Result to:(V)
is equivalent to Spur (A,7,V)
Absmax (A)beginof search:(N)endof search:(M,Yy,I)
is equivalent to Absmax (A,N,M,Yy,I)
Innerproduct(A(t,P,u),B(P),10,P,Y)
&_ These examples correspond to examples given in section 5.4.2.
4.7.3 S_e_m_a_n_t_i_c_s_
A procedure statement serves to invoke (call for) the execution
of a procedure body (cf. section 5.4 Procedure declarations).
Where the procedure body is a statement written in ALGOL. The ef-
fect of this execution will be equivalent to the effect of per-
forming the following operations on the program at the time of
execution of the procedure statement:
The zone of a zone expression is always evaluated before the pro-\f
cudure is entered.
An array field is evaluated before the procedure is entered. The
evaluation is made like this:
a) The bound halfwords are computed as shown in section 5.7.5.
b) The lower bound halfword is adjusted relative to the value
found above. The adjustment will assure that all halfwords in
the lowest array element are available. The adjustment is made
as follows:
T_ lower _bound _halfword:=
lower_bound_halfword +
(1-lower_bound_halfword) extract log2(type_length)
where
&_ log2(x) = ln(x)/ln(2)
c) A description of a one-dimensional array of the resulting type
and with these bound bytes is set up local to the procedure.
If the procedure uses this array as an actual array field
parameter in subsequent procedure calls, this cutting may be
performedagain. Thus, from a certain step, the bytes of an
array may be unaccessible from the procedures, if the values
of the array field variables are not chosen appropriately.
A parameter specified as a field variable may correspond to an
actual parameter of type integer. A field variable as an actual
parameter behaves as a variable of type integer.
A parameter specified as a field variable cannot be called by
value.
T_ 4.7.3.1 V_a_l_u_e_ _a_s_s_i_g_n_m_e_n_t_ _(_c_a_l_l_ _b_y_ _v_a_l_u_e_)_. All formal parameters quoted in
the value part of the procedure declaration heading (see Sections
&_ 5.4 and 4.7.4) are assigned the values (cf. section 2.8 Values
and types) of the corresponding actual parameters, these assign-
ments being considered as being performed explicitly before ente-
ring the procedure body. The effect is as though an additional
block embracing the procedure body were created in which these
assignments were made to variables local to this fictive block
with types as given in the corresponding specifications (cf.
section 5.4.5). As a consequence, variables called by value may
be considered as non local to the body of the procedure, but
local to the fictive block (cf. section 5.4.3). \f
4.7.3.2 N_a_m_e_ _r_e_p_l_a_c_e_m_e_n_t_ _(_c_a_l_l_ _b_y_ _n_a_m_e_)_. Any formal parameter not quoted
in the value list is replaced, throughout the procedure body, by
the corresponding actual parameter, after enclosing this latter
in parentheses wherever syntactically possible. Possible conflict
between identifiers inserted through this process and other iden-
tifiers already present within the procedure body will be avoided
by suitable systematic changes of the formal or local identifiers
involved.
4.7.3.3 B_o_d_y_ _r_e_p_l_a_c_e_m_e_n_t_ _a_n_d_ _e_x_e_c_u_t_i_o_n_. Finally the procedure body, modi-
fied as above, is inserted in place of the procedure statement
and executed. If the procedure is called from a place outside the
scope of any non-local quantity of the procedure body the con-
flicts between the identifiers inserted through this process of
body replacement and the identifiers whose declarations are valid
at the place of the procedure statement or function designator
will be avoided through suitable systematic changes of the latter
identifiers.
4.7.4 A_c_t_u_a_l_ _-_f_o_r_m_a_l_ _c_o_r_r_e_s_p_o_n_d_a_n_c_e_.
The correspondance between the actual parameters of the procedure
statement and the formal parameters of the procedure heading is
established as follows: The actual parameter list of the proce-
dure statement must have the same number of entries as the formal
parameter list of the procedure declaration heading. The corre-
spondence is obtained by taking the entries of these two lists in
the same order.
4.7.5 R_e_s_t_r_i_c_t_i_o_n_s_.
For a procedure statement to be defined it is usually necessary
that the operations on the procedure body defined in section
4.7.3.1 and 4.7.3.2 lead to a correct ALGOL 7 statement.
This poses the general restriction on any procedure statement
that the kind and type of each actual parameter be compatible
with the kind and type of the corresponding formal parameter. For
reasons of effectivity of the compiled code certain deviations
from this general rule are imposed. Some particular cases of this
rule together with the deviations are listed in the following: \f
4.7.5.1I_f_ _a_ _s_t_r_i_n_g_ _i_s_ _s_u_p_p_l_i_e_d_ _a_s_ _a_n_ _a_c_t_u_a_l_ _p_a_r_a_m_e_t_e_r_ in a procedure
statement or function designator, where the procedure body is an
ALGOL 7 statement (as opposed to non-ALGOL code, cf. section
4.7.8), then this string can only be used within the procedure
body as an actual parameter in further procedure calls. Ultimate-
ly it can only be used by a procedure body expressed in non-ALGOL
code. (In very specific cases this rule may be circumvented, if
the actual string parameters are short strings (cf. Section
3.6.3.)).
4.7.5.2A_ _f_o_r_m_a_l_ _n_a_m_e_ _p_a_r_a_m_e_t_e_r_ which occurs as a left part variable in
an assignment statement within the procedure, may actually be an
expression which is not a variable (a constant for instance). In
this case, the assignment takes place to a fictive variable.
If the actual parameter is a constant, the future value will be
taken from this fictive variable, and if it is an expression, the
assignment disappears as the fictive variable is a normal used
work variable (UV cf. ref. 10).
4.7.5.3 A_n_ _a_c_t_u_a_l_ _p_a_r_a_m_e_t_e_r_ which is an array identifier can only corre-
spond to a formal array parameter with the same number of sub-
scripts or with one subscript. In the latter case, the lexicogra-
phical ordering of the array elements is used as explained in
5.2.6. An array field is considered as a one-dimensional array
(see 4.7.3).
The number, kind and type of any parameters of a formal procedure
parameter must be compatible with those of the actual parameter.
If a formal parameter is specified as a field variable, it is not
checked whether the actual parameter is a field variable. A for-
mal parameter specified as real array may actually be a zone ex-
pression. In this case, the array elements are that part of the
zone buffer which is selected as the zone record at the moment of
the call.
4.7.5.4 (_T_h_i_s_ _s_e_c_t_i_o_n_ _h_a_s_ _b_e_e_n_ _d_e_l_e_t_e_d_)_
4.7.5.5 R_e_s_t_r_i_c_t_i_o_n_s_ _i_m_p_o_s_e_d_ _b_y_ _s_p_e_c_i_f_i_c_a_t_i_o_n_s_ of formal parameters must
be observed. The correspondence between actual and formal parame-
ters should be in accordance with the following table.
If the actual parameter is itself a formal parameter the corre-
spondence (as in the table on the previous page) must be with the
specification of the immediate actual parameter rather than with
the declaration of the ultimate actual parameter. \f
T_ F_o_r_m_a_l_ _p_a_r_a_m_e_t_e_r_ _ _ _ ___M_o_d_e_ _ _ _ _ _ _A_c_t_u_a_l_ _p_a_r_a_m_e_t_e_r_ _________________
integer value arithmetic expression yielding a
real or integer value.
name arithmetic expression yielding an
integer value
long value arithmetic expression yielding a
long value
name arithmetic expression yielding a
long value
real value arithmetic expression yielding a
real or integer value
name arithmetic expression yielding a
real value
boolean value boolean expression
name boolean expression
label name designational expression
integer array name integer array
long array name long array
real array name real array or zone
boolean array name boolean array
integer field name arithmetic expression yielding an
integer value
long field name arithmetic expression yielding an
integer value
real field name arithmetic expression yielding an
integer value
boolean field name arithmetic expression yielding an
integer value
integer array field name arithmetic expression yielding an
integer value
long array field name arithmetic expression yielding an
integer value
real array field name arithmetic expression yielding an
integer value
boolean array field name arithmetic expression yielding an
integer value
typeless procedure name arithmetic procedure, or typeless
procedure, or boolean procedure
integer procedure name integer procedure
long procedure name long procedure
real procedure name real procedure
boolean procedure name boolean procedure
switch name switch
string name string expression
zone name zone expression
&_zone array name zone array \f
4.7.6 (_T_h_i_s_ _s_e_c_t_i_o_n_ _h_a_s_ _b_e_e_n_ _d_e_l_e_t_e_d_)_
4.7.7 P_a_r_a_m_e_t_e_r_ _d_e_l_i_m_i_t_e_r_s_.
All parameter delimiters are understood to be equivalent. No cor-
respondence between the parameter delimiters used in a procedure
statement and those used in the procedure heading is expected be-
yond their number being the same. Thus the information conveyed
by using the elaborate ones (known as "fat commas") is entirely
optional.
4.7.8 P_r_o_c_e_d_u_r_e_ _b_o_d_y_ _e_x_p_r_e_s_s_e_d_ _i_n_ _s_l_a_n_g_ _c_o_d_e_.
The restrictions imposed on a procedure statement calling a pro-
cedure having its body expressed in non-ALGOL code can only be
derived from the characteristics of the code used and the intent
of the user. Therefore it is outside the scope of this part of
the manual.
4.7.9 S_t_a_n_d_a_r_d_ _p_r_o_c_e_d_u_r_e_s_
The standard procedures belonging to the ALGOL 7 system are de-
scribed in ref. 14.
4.7.10 R_e_c_u_r_s_i_v_e_ _p_r_o_c_e_d_u_r_e_s_
Recursive procedures are handled fully in ALGOL 7, note however
the possible "cutting" of array parameters which are actually
arrays fields described in 4.7.3.
If a variable is declared "own" in a procedure body and the proce-
dure is called recursively, the same own variable is used in all
the dynamic incarnations of the procedure.
T_ 4.8 C_o_n_t_e_x_t_ _s_t_a_t_e_m_e_n_t_s_
4.8.1 S_y_n_t_a_x_
exit statement'
context statement' ::= continue statement'
exit statement' ::= exit (designational expression')
&_ continue statement' ::= continue
T_ 4.8.2 E_x_a_m_p_l_e_s_
exit (L)
exit (Q(1))
&_ continue
\f
4.8.3 S_e_m_a_n_t_i_c_s_
The context statement serves to control special jumps out of a
context block and within a context block. The statements should
be found in a context block only.
E_x_i_t_
The exit statement is a goto statement, which leaves a context
block in such a manner that the same incarnation (cf. 5.8.1) can
start the execution next time with the ALGOL statement immediate-
ly following the exit call.
The block level at which an exit statement is found shall be
identical with the level of the context block.
The statement shall be found outside for-statements embedded in
context blocks.
The exit statement has the following effect:
The return point (also known as the c_o_n_t_i_n_u_e_ _p_o_i_n_t_), i.e. the
logical address for the ALGOL statement following immediately
after the exit statement, is stored in an anonymous context
variable (cf. 5.8.3). This variable is known as the c_o_n_t_e_x_t_ _l_a_b_e_l_
belonging to the incarnation.
Jumping to the value of designational expression', is done
exactly in the same manner as via a goto statement (cf. 3.3).
Several exit statements are permittet in the same context block,
and each incarnation has its specific c_o_n_t_e_x_t_ _l_a_b_e_l_.
The value of a context label is either a continue point or 0
(zero). A continue point can be defined solely by exit. The zero
value can be obtained in the following manner:
T_ First time this incarnation is executed.
When read bit has not been set.
When "new block bit" or "new incarnation bit" is set.
& (cf. 5.8.3).
C_o_n_t_i_n_u_e_
The continue statement is a goto statement that jumps to a con-
text label. The block label at which it is found may be different
from the context block level (i.e. inner block). The statement
has the following effect:
\f
If the context label belonging to the incarnation is zero, the
statement is blind. This means that the block goes on with the
next ALGOL statement.
If the context label belonging to the incarnation has the value
of a continue point, the block jumps to the point concerned.
\f
F_ 5. D_e_c_l_a_r_a_t_i_o_n_s_
Declarations serve to define certain properties of the quantities
used in the program, and to associate them with identifiers. A
declaration of an identifier is valid for one block. Outside this
block the particular identifier may be used for other purposes
(see Section 4.1.3).
Dynamically this implies the following: at the time of an entry
into a block (through the begin since the labels inside are local
and therefore inaccessible from outside) all identifiers declared
for the block assume the significance implied by the nature of
the declarations given. If these identifiers had already been de-
fined by other declarations outside they are for the time being
given a new significance. Identifiers which are not declared for
the block, on the other hand, retain their old meaning.
At the time of an exit from a block (through end, or by a go to
statement) all identifiers which are declared for the block lose
their local significance.
A declaration of a simple variable may be marked with the addi-
tional declarator own. This has the following effect: upon a re-
entry into the block, the values of own quantities will be un-
changed from their values at the last exit, while the values of
declared variables which are not marked as own are undefined. Va-
riables declared in a context block will behave as if they were
marked with the declarator own.
No identifier may be declared either explicitly or implicitly
(see Section 4.1.3) more than once in any one block head.
All programs may be thought of as surrounded by one common block
(the standard identifier block). The declarations of this block
are given in the backing storage catalog of the RC 8000. New pro-
cedure declarations are inserted in this block when external pro-
cedures are translated (see 5.4.7). Procedures expressed in ma-
chine language, simple variables, and zones may be inserted in
the standard identifier block as described in ref. 10.
Apart from labels, formal parameters of procecure declarations,
and identifiers declared in the environmental block, each iden-
tifier appearing in a program must be explicitly declared within
the program. \f
T_ S_y_n_t_a_x_
simple declaration'
&_ declaration' ::= context declaration'
T_ context variable declaration'
simple declaration' ::= zone declaration'
&_ zone array declaration'
T_ type declaration'
array declaration'
context variable declaration' ::= switch declaration'
procedure declaration'
field declaration'
&_
T_ 5.1 T_y_p_e_ _d_e_c_l_a_r_a_t_i_o_n_s_
5.1.1 S_y_n_t_a_x_
*
&_ type list' ::= simple variable' ,simple variable' 0
T_ real
type' ::= long
integer
&_ boolean
T_1
&_ type declaration' ::= own 0 type'type list'
T_ 5.1.2 E_x_a_m_p_l_e_s_
integer p,q,s
own boolean Acryl,n
&_ long lg
5.1.3 S_e_m_a_n_t_i_c_s_
Type declarations serve to declare certain identifiers to repre-
sent simple variables of a given type. The range and representa-
tion of variables are given in 3.1.
T_ 5.2 A_r_r_a_y_ _d_e_c_l_a_r_a_t_i_o_n_s_
5.2.1 S_y_n_t_a_x_
lower bound' ::= arithmetic expression'
&_ upper bound' ::= arithmetic expression'
bound pair' ::= lower bound':upper bound' \f
T_ *
&_bound pair list' ::= bound pair' ,bound pair' 0
T_array segment' ::= array identifier' (bound pair list')
&_ ,array segment'
T_ *
&_array list' ::= array segment' ,array segment'0
T_ 1
&_array declarer' ::= type' 0 array
T_ 1
&_array declaration' ::= type' 0 array array list'
T_ 5.2.2 E_x_a_m_p_l_e_s_
array a, b, c(7:n, 2:m), s(-2:10, -5:-1, 7:10, 13:i)
real array q(-7:if c 0 then 2 else 1)
&_ long array zjjj(1:case i of (7, i, 3))
5.2.3 S_e_m_a_n_t_i_c_s_
An array declaration declares one or severel identifiers to re-
present multidimensional arrays of subscripted variables and
gives the dimensions of the arrays, the bounds of the subscripts,
and the types of the variables.
5.2.3.1 S_u_b_s_c_r_i_p_t_ _b_o_u_n_d_s_. The subscript bounds for any array are given in
the first subscript brackets following the identifier of this ar-
ray in the form of a bound pair list. Each item of this list
gives the lower and upper bounds of a subscript in the form of
two arithmetic expressions separated by the delimiter :. The bound
pair list gives the bounds of all subscripts taken in order from
left to right.
5.2.3.2 D_i_m_e_n_s_i_o_n_s_. The dimensions are given as the number of entries in
the bound pair lists.
5.2.3.3 T_y_p_e_s_. All arrays declared in one declaration are of the same
quoted type. If no type declarator is given the real type is
understood.
5.2.4 L_o_w_e_r_ _u_p_p_e_r_ _b_o_u_n_d_ _e_x_p_r_e_s_s_i_o_n_s_.
At least one element must be declared.
5.2.4.1 T_h_e_ _e_x_p_r_e_s_s_i_o_n_s_ will be evaluated in the same way as subscript
expressions (see Section 3.1.4.2).
5.2.4.2 T_h_e_ _e_x_p_r_e_s_s_i_o_n_s_ cannot include any identifier that is declared\f
either explicitly or implicitly (see Section 4.1.3), in the same
block head as the array in question. Own variables, having an
initial value may however be used.
5.2.4.3A_n_ _a_r_r_a_y_ _i_s_ _d_e_f_i_n_e_d_ only when the values of all upper subscript
bounds are not smaller than those of the corresponding lower
bounds. The array should be declared so that:
The product of the lower subscript bounds and the type_length is
'-2**22.
The product of the upper subscript bounds and the type_length is
2**22.
The product of the number of subscribt elements and the type_length
is 2**22.
5.2.4.4 T_h_e_ _e_x_p_r_e_s_s_i_o_n_s_ will be evaluated once at each entrance into the
block.
5.2.5 (_T_h_i_s_ _s_e_c_t_i_o_n_ _h_a_s_ _b_e_e_n_ _d_e_l_e_t_e_d_)_
5.2.6 L_e_x_i_c_o_g_r_a_p_h_i_c_a_l_ _o_r_d_e_r_i_n_g_
The elements of an array are stored in a sequence, and a
multi-dimensional array declared
Am(low1:up1,low2:up2,...lown:upn)
may in certain connections (specified in 5.2.6.1 and 5.2.6.2) be
considered as a one-dimensional array
Ao(low:up).
Whenever the mapping of Am and Ao makes sense, the element
Am(i1,i2,...,in)
may be found as
Ao(...((i1*c2+i2)*c3+i3)*...+in)
where
c2 = up2 - low2 + 1, c3 = up3 - low3 + 1, and so on. \f
This mapping of elements is called the lexicographical ordering
because it is a linear ordering of the elements obtained by
varying the first subscripts at the lowest rate.
T_ The values of low and up may be seen to be:
low = ...((low1*c2 + low2)*c3 + low3)* ... + lown
up = ...((up1 *c2 + up2 )*c3 + up3 )* ... + upn
It may also be seen that the (possibly fictive) element
&_ Am(0,0,...,0) is the same as Ao(0).
5.2.6.1 M_u_l_t_i_-_d_i_m_e_n_s_i_o_n_a_l_ _a_r_r_a_y_ _a_s_ _a_c_t_u_a_l_ _p_a_r_a_m_e_t_e_r_. A multi-dimensional
array may occur as an actual parameter where the corresponding
formal is a one dimensional array. The mapping above is used in
that case.
5.2.6.2 M_u_l_t_i_-_d_i_m_e_n_s_i_o_n_a_l_ _a_r_r_a_y_ _a_s_ _f_i_e_l_d_ _b_a_s_e_. Whenever a multi-dimensio-
nal array is used in a field reference as the (ultimate) field
base, the halfword numbering and addressing described in 5.2.7
and 5.2.8 is found by mapping the multi-dimensional field base on
a one-dimensional field base according to the rules above.
5.2.7 B_o_u_n_d_ _h_a_l_f_w_o_r_d_s_ _a_n_d_ _h_a_l_f_w_o_r_d_ _n_u_m_b_e_r_i_n_g_._
Each element of an array is represented by a number of halfwords.
This number is the type length explained in section 3.1.6.
T_ The first halfword in an array is called the lower bound halfword
and the last one the upper bound halfword. Let an array be de-
clared
A(low:up)
then
lower _bound _halfword = (low - 1)*type _length + 1
&_ upper _bound _halfword = up*type _length.
The halfwords of an array are numbered relative to the rightmost
halfword in the (possibly fictive) element A(O). The element A(i)
T_contains the halfwords
&_ (i - 1)*type _length + 1 = halfword _number = i* type _length.
5.2.8 W_o_r_d_ _b_o_u_n_d_a_r_i_e_s_ _a_n_d_ _a_d_d_r_e_s_s_e_s_.
When an array is declared, it is created so that the word
boundaries are between an even numbered halfword and its odd
numbered successor.
An array element, A(i), is addressed within the array be the half-
word with the number i*type_length. \f
T_ 5.3 S_w_i_t_c_h_ _d_e_c_l_a_r_a_t_i_o_n_
5.3.1 S_y_n_t_a_x_
switch list' ::= *
designational expression' ,designational expression' 0
&_switch declaration' ::= switchswitch identifier':= switch list'
T_ 5.3.2 E_x_a_m_p_l_e_s_
switch S:= S1,S2,Q(m), if v ' -5 then S3 else S4
&_ switch Q:= p1,w
5.3.3 S_e_m_a_n_t_i_c_s_
A switch declaration defines the set of values of the correspon-
ding switch designators. These values are given one by one as the
values of the designational expressions entered in the switch
list. With each of these designational expressions there is asso-
ciated a positive integer, 1, 2,..., obtained by counting the
items in the list from left to right. The value of the switch de-
signator corresponding to a given value of the subscript expres-
sion (see Section 3.5 Designational expressions) is the value of
the designational expression in the switch list having this given
value as its associated integer.
5.3.4 E_v_a_l_u_a_t_i_o_n_ _o_f_ _e_x_p_r_e_s_s_i_o_n_s_ _i_n_ _t_h_e_ _s_w_i_t_c_h_ _l_i_s_t_.
An expression in the switch list will be evaluated every time the
item of the list in which the expression occurs is referred to,
using the current values of all variables involved.
5.3.5 I_n_f_l_u_e_n_c_e_ _o_f_ _s_c_o_p_e_s_
If a switch designator occurs outside the scope of a quantity
entering into a designational expression in the switch list, and
an evaluation of this switch designator selects this designatio-
nal expression, then the conflicts between the identifiers for
the quantities in this expression and the identifiers whose de-
clarations are valid at the place of the switch designator will
be avoided through suitable systematic changes of the latter
identifiers.
T_5.4P_r_o_c_e_d_u_r_e_ _d_e_c_l_a_r_a_t_i_o_n_
5.4.1 S_y_n_t_a_x_
&_ formal parameter' ::= identifier'
\f
T_formal parameter list' ::= *
formal parameter' parameter delimiter'formal parameter' 0
1
&_ formal parameter part' ::= (formal parameter list') 0
T_ *
&_ identifier list' ::= identifier' ,identifier' 0
T_ 1
&_ value part' ::= value identifier list'; 0
T_ string
type'
array
type' array
label
switch
specifier' ::= procedure
type' procedure
type' field
array field
type' array field
zone
&_ zone array
T_ 1
&_ specification part' ::= specifier'identifier list'; 0
T_ procedure heading' ::=
&_ procedure identifier'formal parameter part';value part'specification part'
procedure body' ::= statement'
T_procedure declaration' ::=
1
&_ type' 0 procedureprocedure heading'procedure body'
T_ 5.4.2 E_x_a_m_p_l_e_s_
procedure Spur(a,n,s);
value n; real array a; integer n; real s;
*sum all elements in the diagonal up to element a(n,n)*'
begin integer k;
s:=0;
for k:= 1 step 1 until n do s := s + a(k,k)
&_ end
\f
T_ procedure Transpose(a,n);
value n; array a; integer n;
begin real w; integer i,k;
for i:= 1 step 1 until n do
for k:= 1 + i step 1 until n do
begin w:= a(i,k);
a(i,k):= a(k,i);
a(k,i):= w
end
&_ end transpose
T_integer procedure stepfct(u);
value u; real u;
&_stepfct:= if 0=u and u=1 then 1 else 0
T_ procedure Absmax(a,n,m,y,i);
value n,m;real array a;integer n,m,i;real y;
* The absolute greatest element in the vector a, and with a
subscript interval n= index =m is transferred to y, and the
subscript of this element to i *'
begin integer p;
y:= 0; i:= n;
for p:= n step 1 until m do
if abs a(p) ' y then
begin y:= abs a(p);
i:=p
end
&_ end Absmax
T_ procedure Innerproduct(a,b) Order:(k,p) Result:(y);
* here the fat comma )letter string':( is used as parameter
delimiter, the above is equivalent to procedure Innerproduct
(a,b,k,p,y);*' integer k,p; real y,a,b;
begin real s;
s:=0;
for p:= 1 step 1 until k do s:= s + a * b;
y:=s
&_ end Innerproduct
5.4.3 S_e_m_a_n_t_i_c_s_
A procedure declaration serves to define the procedure associated
with a procedure identifier. The principal constituent of a pro-
cedure declaration is a statement or a piece of code, the proce-
dure body, which through the use of procedure statements and/or
function designators may be activated from other parts of the\f
block in the head of which the procedure declaration appears. As-
sociated with the body is a heading, which specifies certainiden-
tifiers occurring within the body to represent formal parameters.
Formal parameters in the procedure body will, whenever the proce-
dure is activated (cf. section 3.2 Function designators and sec-
tion 4.7 Procedure statements) be assigned the values of or re-
placed by actual parameters. Identifiers in the procedure body
which are not formal will be either local or non-local to the bo-
dy depending on whether they are declared within the body or not.
Those of them which are non-local to the body may well be local
to the block in the head of which the procedure declaration ap-
pears.
The procedure body always acts like a block, whether it has the
form of one or not. Consequently the scope of any label labelling
a statement within the body or the body itself can never extend
beyond the procedure body. In addition, if the identifier of a
formal parameter is declared anew within the procedure body (in-
cluding the case of its use as a label as in section 4.1.3), it
it is thereby given a local significance and actual parameters
which correspond to it are inaccessible throughout the scope of
this inner local quantity. If the procedure body is a block, an
identifier of a formal parameter must not be declared anew in
this outermost block.
No identifier may appear more than once in any formal parameter
list, nor may a formal parameter list contain the procedure iden-
tifier of the same procedure heading.
5.4.4 V_a_l_u_e_s_ _o_f_ _f_u_n_c_t_i_o_n_ _d_e_s_i_g_n_a_t_o_r_s_.
For a procedure declaration to define the value of a function
designator there should, within the procedure body, occur one or
more uses of the procedure identifier as a destination, at least
one of these should be executed. The type associated with the
procedure identifier must be declared through the appearance of a
type declarator as the very first symbol of the procedure decla-
ration. The last value so assigned is used to continue the evalu-
ation of the expression in which the function designator occurs.
Any occurrence of the procedure identifier within the body of the
procedure other than as a destination in an assignment statement
denotes activation of the procedure.
If a goto statement within the procedure, or within any other
procedure activated by it, leads to an exit from the procedure,
other than through its end, then the execution, of all statements\f
that have been started but not yet completed and which do not con-
tain the label to which the go to statement leads, is abandoned.
The values of all variables that still have significance remain
as they were immediately before execution of the go to statement.
If a function designator is used as a procedure statement, then
the resulting value is discarded, but such a statement may be
used, if desired, for the purpose of invoking side-effects (cf.
3.3.5).
5.4.5 S_p_e_c_i_f_i_c_a_t_i_o_n_s_
The heading includes a specification part, giving information
about the kinds and types of all the formal parameters. In this
part no formal parameter may occur more than once.
Restrictions on the actual/formal correspondence are listed in
section 4.7.5.5.
Note that arrays cannot be value specified.
5.4.6 C_o_d_e_ _a_s_ _p_r_o_c_e_d_u_r_e_ _b_o_d_y_
Procedures may be expressed in machine language and introduced
into the standard identifier block (see the introduction to chap-
ter 5) as it is explained in ref. 10.
5.4.7 P_r_o_c_e_d_u_r_e_s_ _t_r_a_n_s_l_a_t_e_d_ _a_l_o_n_e_
Procedures expressed in Algol may be translated alone, provided
that they have at most seven parameters. A procedure translated
alone will be introduced into the standard identifier block men-
tioned in the introduction to chapter 5. In order to translate
the procedure alone, the procedure declaration must be surrounded
by the delimiters external and end, and a semicolon (;) must de-
limit the procedure declaration from the end.
A procedure translated in this way becomes a standard procedure
included in the standard identifier block. The name of the proce-
dure is the name of the backing storage area into which the pro-
cedure is translated.
All identifiers used as standard identifiers by the procedure
must be present at the time of compilation. The name of an ex-
ternal procedure must not contain capital letters as these are
forbidden in names of backing storage areas.
\f
T_5.4.7.1 E_x_a_m_p_l_e_
external real procedure greatest (x,y,i);
value x,y;real x,y;integer i;
begin
real work;
i:= 0;
work:= if x ' y then x else y;
if work = y then i:= 1;
greatest:= work;
end;
&_ end
T_5.5Z_o_n_e_ _d_e_c_l_a_r_a_t_i_o_n_s_
5.5.1 S_y_n_t_a_x_
length' ::= arithmetic expression'
&_ shares' ::= arithmetic expression'
block proc' ::= procedure identifier'
T_ zone segment' ::=
zone identifier' (length',shares',block proc')
&_ ,zone segment'
T_ *
zone list' ::= zone segment' ,zone segment'0
&_ zone declaration' ::= zone zone list'
T_ 5.5.2 E_x_a_m_p_l_e_s_
zone master(2*bl,2,stderror)
&_ zone m1,m2(a,b,c),m3(900,3,pr)
5.5.3 S_e_m_a_n_t_i_c_s_
A zone declaration declares one or several identifiers to repre-
sent zones. The arithmetic expressions in the declaration are
evaluated once for each entrance into the block. Each zone con-
sists of:
a b_u_f_f_e_r_ _a_r_e_a_
a z_o_n_e_ _d_e_s_c_r_i_p_t_o_r_
one or more s_h_a_r_e_ _d_e_s_c_r_i_p_t_o_r_s_ (often just called s_h_a_r_e_s_)
Inside the block, a zone identifier may occur as an actual para-
meter, as a constituent of a record variable, or as a field base
(cf. 3.1).
B_u_f_f_e_r_ _a_r_e_a_
The length in reals of the buffer area for any zone is given by
length' in the first parenthesis following the zone identifier. \f
Each element of the buffer area may be used as a real variable as
explained for zone record below. The elements are in some connec-
tions identified by a halfword number in the range
1 = halfword number = 4*length.
Z_o_n_e_ _d_e_s_c_r_i_p_t_o_r_
A zone descriptor consists of the following set of quantities,
which specify a process or a document (see ref. 1) connected to
the zone and the state of this process:
process name A text string specifying the name of a pro-
cess or a document connected to the zone.
mode and kind An integer specifying mode and kind for a
document (see ref. 14, open).
logical position A set of integers specifying the current po-
sition of a document.
give up mask An integer specifying the conditions under
which block proc is to be called.
state An integer specifying the latest operation on
the zone.
record Two integers specifying the part of the buf-
fer area nominated as the zone record.
used share An integer specifying the share descriptor
within the zone, which is used for the moment.
last halfword An integer specifying the end of a physical
block on a document.
block procedure The procedure block proc in the first pa-
renthesis following the zone identifier.
The give up mask and status of the connected
document specifies when this procedure is
called.
S_h_a_r_e_ _d_e_s_c_r_i_p_t_o_r_
Each zone contains the number of share descriptors given by
shares in the first parenthesis following the zone identifiers.
The share descriptors are numbered 1, 2,..., shares .
A share descriptor consists of a set of quantities which describe
an external activity sharing a part of the buffer area with the
running program.
An activity may be a parallel process transferring data between a
document and the buffer area, or it may be a child process execu-
ted in the buffer area under supervisiory control of the algol
program. See ref. 14. \f
The set of quantities forming one share descriptor is:
share state An integer describing the kind of activity
going on in the shared area.
shared area Two integers specifying the part of the
buffer area shared with another process by
means of the share descriptor.
operation Specifies the latest operation performed by
means of the share descriptor.
Z_o_n_e_ _r_e_c_o_r_d_
A number of consecutive halfwords of the buffer area may at run
time be nominated as the zone record. The halfwords of the zone
record may be available as r_e_c_o_r_d_ _v_a_r_i_a_b_l_e_s_, which may be thought
of as a kind of real subscripted variables. The record variables
are numbered 1, 2..., record length (the max addressable word in
the buffer), and referenced as described in 3.1.
All halfwords of the record may be referenced by means of field
references, as the zone may be used as a field base.
Z_o_n_e_ _a_f_t_e_r_ _d_e_c_l_a_r_a_t_i_o_n_
The following parts of the zone is defined just after declara-
tion.
T_ used share is set to first share
record is set to the entire buffer area
block proc
&_ The entire buffer area can be accessed as one zone record.
T_5.5.4T_y_p_e_s_
The two expressions length' and shares' must be of type inte-
ger. The procedure block proc' must be declared like this:
&_ procedure block proc' (z,s,b); zone z; integer s,b;
5.5.5 S_c_o_p_e_
All identifiers occuring in length' and shares' must be non-
local to the block. However, block proc' may also be local.
At the time of exit from the block (through end, or by a go to
statement), the activities described by the share descriptors are
terminated as follows: A communication with a parallel process is
completed by means of the monitor function wait answer (see ref. 1).
A running child process is stopped (but not removed, see ref.1).\f
5.5.6 S_t_a_n_d_a_r_d_ _z_o_n_e_s_
Two zones, "in" and "out", are available without declarations.
The declaration is similar to zone in,out (128,1,stderror). (See
ref. 14).
5.5.7 S_t_a_n_d_a_r_d_ _b_l_o_c_k_ _p_r_o_c_e_d_u_r_e_
A procedure "stderror" exists which can be used as standard block
procedure without declaration (cf. ref. 14).
T_ 5.6 Z_o_n_e_ _a_r_r_a_y_ _d_e_c_l_a_r_a_t_i_o_n_s_
5.6.1 S_y_n_t_a_x_
zones' ::= arithmetic expression'
&_ length' ::= arithmetic expression'
shares' ::= arithmetic expression'
block proc' ::= procedure identifier'
T_ zone array list' ::=
zone array list',zone array list'
zone array identifier'(zones',length',shares',block proc')
&_ zone array declaration' ::= zone array zone array list'
T_ 5.6.2 E_x_a_m_p_l_e_s_
zone array inmerge(3,2*600,2,stderror),
&_ outmerge(3,2*600,2,stderror)
5.6.3 S_e_m_a_n_t_i_c_s_
A zone array declaration declares one or more identifiers to re-
present one-dimensional arrays of zones. The arithmetic expres-
sions in the declaration are evaluated once for each entrance
into the block. Each zone array consists of as many zones as spe-
cified by zones . All these zones' are declared with length',
shares', and block proc' as specified (cf. section 5.5). The
zones of a zone array are numbered 1, 2,..., zones'.
Inside a block, a zone array identifier may occur as an actual
parameter, as a constituent of a subscripted zone occurring as a
parameter (cf. 3.7), or as a constituent of a record variable
(cf. 3.1).
5.6.4 T_y_p_e_s_
zones' must be of type integer. See section 5.5.4 for length',
shares', and block proc'.
\f
5.6.5 S_c_o_p_e_
All identifiers occurring in zones must be non-local to the
block. See section 5.5.5 for length', shares', block proc',
and the exit from the block.
T_ 5.7 F_i_e_l_d_ _d_e_c_l_a_r_a_t_i_o_n_s_
5.7.1 S_y_n_t_a_x_ *
&_ field list' ::= field variable' ,field variable' 0
simple field declaration' ::= type' field field list'
T_ 1
&_array field declaration' ::= type' 0 array field field list'
T_ field declaration' ::= simple field declaration'
&_ array field declaration'
T_ 5.7.2 E_x_a_m_p_l_e_s_
integer field if1, if2
long field lf1
boolean array field bfa1, bfa2
&_ array field rfa1, rfa2, rfa3
5.7.3 S_e_m_a_n_t_i_c_s_
A field declaration serves to declare one or several identifiers
as field variables.
Field variables are integers and may be used whereever an integer
variable may be used.
A variable field declaration declares simple field variables and
an array field declaration declares array field variables.
The type declared together with the field variables, the associa-
ted type, has no meaning outside field references.
All field variables declared in one declaration have the same
associated type. If no type declarator is given in an array field
declaration the type real is understood.
5.7.4 L_o_c_a_t_i_o_n_ _o_f_ _a_ _v_a_r_i_a_b_l_e_ _f_i_e_l_d_
A variable field is located within a field base which may be an
array, a zone record, or an array field.
The denotation of a variable field is shown in section 3.1. \f
The variable field consists of as many halfwords as the type
length of the associated type shows.
A variable field cannot occupy halfwords outside the bound half-
words (cf. section 5.2.7 and section 3.1.4.3).
The integer value of the field variable specifies a halfword num-
ber.This halfword number is used as an address in the correspon-
ding field base.
Boolean fields are addressed by their halfword number. Integer,
long, and real fields are synchronized with the word boundaries
(cf. section 5.2.8) of the RC 8000. Integer fields are addressed
by one of the 2 bytes forming the integer word. Long and real
fields are addressed by one of the 2 halfwords in the right hand
word. The address must be
'= lower bound halfword + type length - 1
and it must be = upper bound halfword, of the corresponding
field base.
5.7.5 L_o_c_a_t_i_o_n_ _a_n_d_ _b_o_u_n_d_s_ _o_f_ _a_n_ _a_r_r_a_y_ _f_i_e_l_d_
An array field is located within the field base. For an array
field variable the halfword number should be lower bound half-
word -1, where lower bound halfword is the lower bound of the
wanted array addressed within the field base. The halfword number
referring to a certain piece of data in the array field is found
by subtracting the value of the array field variable from the
corresponding halfword number in the field base.
If the field base is an array field, this rule may be used recur-
sively.
The bound halfword numbers are given by the formula:
T_ bound halfword of array field =
&_ bound halfword of field base - value of array field variable.
A subscripted element in an array field is addressed according to
the rule in section 5.2.8. The address of a subscripted element
must be '= lower bound halfword + type length - 1
and it must be = upper bound halfword.
\f
T_ 5.8 C_o_n_t_e_x_t_ _d_e_c_l_a_r_a_t_i_o_n_s_
5.8.1 S_y_n_t_a_x_
context declaration' ::=
&_ context(incarnation',no of incarnations',context mode')
incarnation' ::= arithmetic expression'
no of incarnations' ::= arithmetic expression'
context mode' ::= arithmetic expression'
T_ 5.8.2 E_x_a_m_p_l_e_s_
context (i, M+N, 3)
context (if p then 1 else 4, Q, 1 shift 1)
&_
5.8.3 S_e_m_a_n_t_i_c_
A context declaration serves to indicate that the actual block is
a context block (cf. 4.1.1). The variables declared in the block
are denoted context variables.
A context declaration defines a number of incarnations of the de-
clared block; these incarnations are numbered: 1, 2, 3 ..., no
of incarnations'; the declarator parameter incarnation' repre-
sents such an incarnation number. To each execution of a context
block is related an incarnation number. If two different execu-
tions of a context block have the same incarnation number, they
define the same incarnation of the context block. The number of
different incarnations is thus equal to the value of the declara-
tor parameter: no of incarnations'.
The effect of a context declaration is now that the context va-
riables declared in the context block are initialized to values
depending on the incarnation before the first statement in the
block is executed. When the block is left (via the last end in
the block or by means of a goto statement) the values of its con-
text variables are stored, and these variables will be initialized
to the stored values in the following execution of the same incar-
nation of the block.
The parameter context mode' affects this initialization and sto-
ring of context variables. See 5.8.3.4. In more detail, the con-
text declarator functions as follows:
5.8.3.1 I_n_c_a_r_n_a_t_i_o_n_ _I_n_t_e_r_v_a_l_. When a context block is executed first
time, the actual value of no of incarnations' defines the number
of different incarnations of the block. This value will then re-\f
main unchanged for the rest of the program run, although the va-
lue may be changed by the program during the run. The value can
be changed using the context mode "new block bit" (cf. 5.8.3.4).
This value defines the incarnation interval: 1 = incarnation =
no of incarnations.
5.8.3.2 I_n_i_t_i_a_l_i_z_a_t_i_o_n_ _o_f_ _C_o_n_t_e_x_t_ _V_a_r_i_a_b_l_e_s_. When a context block is en-
tered, and before the first statement is executed, the following
is done:
The value of incarnation' is evaluated, and it is verified that
it is within the incarnation interval. This incarnation is used
throughout the execution of the context block, although the value
of incarnation' may be changed in the block. This concept is si-
milar to value parameters in procedures. To an incarnation is re-
lated just one record, the fields of which are identical with the
declared context variables. To each context block are thus con-
nected no of incarnations' records. Such records are known as
context records. The context variables of the block are initia-
lized if the incarnation concerned has been executed before, the
contents of the corresponding context record will be transferred
to the context variables of the block. If it is a first-time exe-
cution of the incarnation concerned, all the context variables of
the block are set to 0. This zero-set of all variables is perfor-
med when "new incarnation bit" is specified, too (cf. 5.8.3.4).
The actual array lengths defines at the same time the maximum
array lengths applicable to this incarnation. This means that an
array length, in all subsequent runs of this incarnation, shall
be less than or equal to the maximum length.Transfer of values
between context records and context variables is done in accor-
dance with the common lexicographic procedure.
5.8.3.3 S_t_o_r_a_g_e_ _o_f_ _C_o_n_t_e_x_t_ _V_a_r_i_a_b_l_e_s_. When a context block is left (via
the last end in the block, an exit statement, or a goto state-
ment) the context variables of the block are stored in the con-
text record belonging to the incarnation, as follows:
If it was the first time the incarnation was executed the corre-
sponding context record is established in the virtual memory con-
nected with the program.
The values of the context variables of the block are transferred
to the context record belonging to the block and its incarnation.
If several context blocks are nested into one another, and if\f
jump-outs occur from several block levels, the process described
above will develop for each of the context blocks thus being
left.
5.8.3.4 C_o_n_t_e_x_t_ _M_o_d_e_. The actual value of context mode' affects the pro-
cess described in 5.8.3.3. The value is regarded as a bit pattern:
T_ 1 shift 0 (read bit):
The updating of the context record described in 5.8.3.3
is not executed unless read bit is set; if read bit is
not set, solely the zerosetting of context variables is
&_ performed.
T_ 1 shift 1 (write bit):
The updating of the context record in virtual memory
described in 5.8.3.3 is not executed unless write bit
is set. Write bit = 0 is therefore usable for referen-
&_ces to and searching in context records.
T_ 1 shift 2 (save bit):
Every time a context block is left the context variables
of the actual incarnation are saved on backing storage
&_ and in virtual memory.
T_1 shift 3 (new block bit):
Same function as if this context block was executed
first time. If context records has been established,
&_ such records are ignored.
T_ 1 shift 4 (new incarnation bit):
Same function as if this incarnation was executed first
&_ time.
T_ 5.8.4 T_y_p_e_s_
incarnation', no of incarnations' and context mode' must all
&_ be of type integer. \f
F_ R_E_F_E_R_E_N_C_E_S_:_
Ref. 1: RC 8000 Monitor, Part 1, Design Philosophy,
A/S Regnecentralen, Copenhagen, 1978
Ref. 2: RC 8000 Monitor, Part 2, Reference Manual
A/S Regnecentralen, Copenhagen, 1978
Ref. 3: RC 8000 Monitor, Part 3, External Processes
A/S Regnecentralen, Copenhagen, 1978
Ref. 4: RC 4000, Computer, Reference Manual
A/S Regnecentralen, Copenhagen, 1969
Ref. 5: RC 8000, Computer, Reference Manual
A/S Regnecentralen, Copenhagen, 1976
Ref. 6: Utility programs, File processor Part 1-3
A/S Regnecentralen, Copenhagen, 1977
Ref. 7: BOSS 2, User"s Manual
A/S Regnecentralen, Copenhagen, 1975
Ref. 8: Operating System S
A/S Regnecentralen, Copenhagen, 1978
Ref. 9: RC Fortran, User"s Manual
A/S Regnecentralen, Copenhagen, 1977
Ref. 10: Code procedures and the run time organisation of algol
programs.
A/S Regnecentralen, Copenhagen, 1970
Ref. 11: R.M. De Morgan et al.: Modified Report on the
Algorithmic Language Algol 60. The computer Journal,
Vol 19, no. 4 pp 364-379
Ref. 12: J.W. Backus, et al.: Revised Report on the Algorithmic
Language Algol 60 (ed. Peter Naur),
A/S Regnecentralen, Copenhagen, 1962
Comm. ACM 6 no. 1 (1963), pp 1-17
Ref. 13: ISO: R646 - 1967 (E), 6 and 7 bit coded character set
for information processing interchange \f
Ref. 14: ALGOL 7, User"s Manual
A/S Regnecentralen, Copenhagen, 1978
Ref. 15: Paul Lindgreen: A comprehensive method for input data
description. Eddap notes no. 14,
A/S Regnecentralen, Copenhagen, 1976 \f
F_ INDEX
All references are given through section numbers. The references
are given in three groups:
Definition: Following the word "definition", reference tothe
syntactic definition (if any) is given.
Use: Following the word "use", references to the occur-
rences in metalinguistic formulae are given. Refe-
rences already quoted in the def-group are not re-
peated.
Text: Following the word "text", the references to defini-
tions given in text are given.
+ see: plus
- see: minus
* see: multiply
/ // see: divide
** see: exponentiation
= = '= ' ' see: relational operator'
== =' and & or ! -, see: logical operator'
, see: comma
. see: decimal point
" see: exponent
: see: colon
; see: semicolon
:= see: colon equal
() see: parentheses or subscript bracket
: :' see: string quote
abs
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
actual parameter'
definition.......................... 3.2.1
actual parameter list'
definition.......................... 3.2.1
actual parameter part'
definition.......................... 3.2.1
use................................. 4.7.1
add
use................................. 3.3.1, 3.4.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
adding operator'
definition.......................... 3.3.1 \f
algol
use................................. 2.3
alphabet
text................................ 2.1
and'
definition.......................... 3.4.1
arithmetic
text................................ 3.3.6
arithmetic expression'
definition.......................... 3.3.1
use................................. 3, 3.1.1, 3.4.1, 4.2.1,
4.6.1, 5.2.1, 5.5.1, 5.8.1
text................................ 3.3.3
arithmetic operator'
definition.......................... 2.3
text................................ 3.3.4
array
use................................. 2.3, 5.2.1
array
text................................ 3.1.4.1
array declaration'
definition.......................... 5.2.1
use................................. 5
text................................ 5.2.3
array declarer'
definition.......................... 5.2.1
use................................. 5.4.1
array identifier'
definition.......................... 3.1.1
use................................. 3.2.1, 4.7.1, 5.2.1
text................................ 2.8
array field
use................................. 5.4.1, 5.7.1
array field'
definition.......................... 3.1.1
use................................. 3.2.1
text................................ 3.1.4.3
array field declaration'
definition.......................... 5.7.1
array field variable'
definition.......................... 3.1.1
array list'
definition.......................... 5.2.1
array segment'
definition.......................... 5.2.1 \f
assignment statement'
definition.......................... 4.2.1
use................................. 4.1.1
text................................ 1, 4.2.3
basic statement'
definition.......................... 4.1.1
use................................. 4.5.1
basic symbol'
definition.......................... 2
begin
use................................. 2.3, 4.1.1
block'
definition.......................... 4.1.1
use................................. 4.5.1
text................................ 1, 4.1.3, 5
block head'
definition.......................... 4.1.1
block proc'
definition.......................... 5.5.1
use................................. 5.6.1
boolean
use................................. 2.3, 5.1.1
text................................ 5.1.3
boolean expression'
definition.......................... 3.4.1
use................................. 3, 3.3.1, 4.2.1, 4.5.1,
4.6.1, 4.6.8, 4.6.12
text................................ 3.4.3
boolean factor'
definition.......................... 3.4.1
boolean primary'
definition.......................... 3.4.1
boolean secondary'
definition.......................... 3.4.1
boolean term'
definition.......................... 3.4.1
bound pair'
definition.......................... 5.2.1
bound pair list'
definition.......................... 5.2.1
bracket'
definition.......................... 2.3
buffer area
text................................ 5.5.3 \f
capital letter'
definition...........................2.2
case clause'
definition...........................3.3.1
use................................. 3.4.1, 3.5.1, 3.6.1, 4.5.1
text................................ 3.3.3
case statement'
definition.......................... 4.5.1
text................................ 4.5.5
closed string'
definition.......................... 2.6.1
code'
use................................. 5.4.1
text................................ 4.7.8, 5.4.6
colon:
use................................. 2.3, 3.2.1, 4.1.1, 4.5.1,
4.6.1, 4.7.1, 5.2.1
colon equal :=
use................................. 2.3, 4.2.1, 4.6.1, 5.3.1
comma,
use................................. 2.3, 3.1.1, 3.2.1, 4.6.1,
4.7.1, 5.1.1, 5.2.1,
5.3.1, 5.4.1
comment
use................................. 2.3
comment convention
text................................ 2.3
compound statement'
definition.......................... 4.1.1
use................................. 4.5.1
text................................ 1
compound tail'
definition.......................... 4.1.1
compund symbols
definition.......................... 2.3
conditional if statement'
definition.......................... 4.5.1
text................................ 4.5.3
conditional statement'
definition.......................... 4.5.1
use................................. 4.1.1
text................................ 4.5.3, 4.5.5
context
use................................. 2.3
text................................ 5.8.1
context block'
definition.......................... 4.1.1
text................................ 5.8.3 \f
context block head'
definition.......................... 4.1.1
context declaration'
definition.......................... 5.8.1
use................................. 5
text................................ 5.8.3
context label.......................... 4.8.3
context mode'
definition.......................... 5.8.1
text................................ 5.8.3.4
context operator'
definition.......................... 2.3
context statement'
definition.......................... 4.8.1
use................................. 4.1.1
text................................ 4.8.3
context variable....................... 5.8.3
context variable declaration'
definition.......................... 5
use................................. 4.1.1
continue point......................... 4.8.3
continue statement'
definition.......................... 4.8.1
text................................ 4.8.3
decimal fraction'
definition.......................... 2.5.1
decimal number'
definition.......................... 2.5.1
text................................ 2.5.3
decimal point
use................................. 2.3, 2.5.1
declaration'
definition.......................... 5
use................................. 4.1.1
text................................ 1, 5
declarator'
definition.......................... 2.3
delimiter'
definition.......................... 2.3
use................................. 2
designational expression'
definition.......................... 3.5.1
use................................. 3, 4.5.1, 5.3.1
text................................ 3.5.3 \f
destination'
definition.......................... 4.2.1
digit'
definition.......................... 2.2.1
use................................. 2, 2.4.1, 2.5.1
dimension
text................................ 5.2.3.2
divide / //
use................................. 2.3, 3.3.1
text................................ 3.3.4.2
do
use................................. 2.3, 4.6.1
d"s'
definition.......................... 2.6.1
dummy statement'
definition.......................... 4.4.1
use................................. 4.1.1
text................................ 4.4.3
else
use................................. 2.3, 3.3.1, 3.4.1, 3.5.1,
4.5.1
text................................ 4.5.3.2
empty'
definition.......................... 1.1
use................................. 2.6.1, 3.2.1, 4.4.1,
4.7.1, 5.1.1, 5.4.1
end
use................................. 2.3, 4.1.1
entier
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
exponent "
use................................. 2.3, 2.5.1
exponentiation **
use................................. 2.3, 3.3.1
text................................ 3.3.4.3
exponent part'
definition.......................... 2.5.1
text................................ 2.5.3
expression'
definition.......................... 3
use................................. 3.2.1, 4.7.1
text................................ 3 \f
exit statement'
definition......................... 4.8.1
text................................ 4.8.3
extend
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
external
use................................. 2.3
extract
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
factor'
definition.......................... 3.3.1
false
use................................. 2.2.2
fat comma.............................. 3.2.1
field
use................................. 2.3, 5.4.1, 5.7.1
field'
definition.......................... 3.1.1
field base'
definition.......................... 3.1.1
field declaration'
definition.......................... 5.7.1
use................................. 5
text................................ 5.7.3
field list'
definition.......................... 5.7.1
field reference'
definition.......................... 3.1.1
field variable'
definition.......................... 3.1.1
text................................ 3.1.3.2
first letter'
definition.......................... 2.6.1
for
use................................. 2.3, 4.6.1
for clause'
definition.......................... 4.6.1
text................................ 4.6.3
for list'
definition.......................... 4.6.1
text................................ 4.6.4 \f
for list element'
definition.......................... 4.6.1
text................................ 4.6.4.1, 4.6.4.2, 4.6.4.3
formal parameter'
definition.......................... 5.4.1
text................................ 5.4.3
formal parameter list'
definition.......................... 5.4.1
formal parameter part'
definition.......................... 5.4.1
for statement'
definition.......................... 4.6.1
use................................. 4.1.1, 4.5.1
text................................ 4.6
function designator'
definition.......................... 3.2.1
use................................. 3.3.1, 3.4.1
text................................ 3.2.3, 5.4.4
goto
use................................. 2.3, 4.3.1
goto statement'
definition.......................... 4.3.1
use................................. 4.1.1
text................................ 4.3.3
identifier'
definition.......................... 2.4.1
use................................. 3.1.1, 3.2.1, 3.5.1,
5.4.1
text................................ 2.4.3
identifier list'
definition.......................... 5.4.1
if
use................................. 2.3, 3.3.1, 4.5.1
if clause'
definition.......................... 3.3.1,
use................................. 3.4.1, 3.5.1, 4.5.1
text................................ 3.3.3, 4.5.3.2
if statement'
definition.......................... 4.5.1
text................................ 4.5.3.1
implication'
definition.......................... 3.4.1
incarnation'
definition.......................... 5.8.1
text................................ 5.8.3 \f
integer
use................................. 2.3, 5.1.1
text................................ 5.1.3
integer'
definition.......................... 2.5.1
text................................ 2.5.4
label
use................................. 2.3, 5.4.1
label'
definition.......................... 3.5.1
use................................. 4.1.1, 4.5.1, 4.6.1
text................................ 1, 4.1.3, 4.7.6
layout'
definition.......................... 2.6.1
layout external part'
definition.......................... 2.6.1
layout number part'
definition.......................... 2.6.1
layout string'
definition.......................... 2.6.1
text................................ 3.6.5.3
left part'
definition.......................... 4.2.1
left part list'
definition.......................... 4.2.1
length'
definition.......................... 5.5.1
use................................. 5.5.1
letter'
definition.......................... 2.1
use................................. 2, 2.4.1, 3.2.1
letter string'
definition.......................... 3.2.1
local
text................................ 4.1.3
local or own'
definition.......................... 5.1.1
use................................. 5.4.1
location
text................................ 4.2.3
logical operator'
definition.......................... 2.3
use................................. 3.4.1
text................................ 3.4.5 \f
logical value'
definition.......................... 2.2.2
use................................. 2, 3.4.1
long
use................................. 2.3, 5.1.1
long
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
lower bound'
definition.......................... 5.2.1
text................................ 5.2.4
minus -
use................................. 2.3, 2.5.1, 3.3.1
text................................ 3.3.4.1
mod
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5
multiply *
use................................. 2.3, 3.3.1
text................................ 3.3.4.1
multiplying operator'
definition.......................... 3.3.1
non-local
text................................ 4.1.3
no of incarnations'
definition.......................... 5.8.1
text................................ 5.8.3
number'
definition.......................... 2.5.1
text................................ 2.5.3, 2.5.4
open string'
definition.......................... 2.6.1
operator'
definition.......................... 2.3
or'
definition.......................... 3.4.1
own
use................................. 2.3, 5.1.1
text................................ 5, 5.2.5
\f
parameter delimiter'
definition.......................... 3.2.1
use................................. 5.4.1
text................................ 4.7.7
parentheses ()
use................................. 2.3, 3.2.1, 3.3.1, 3.4.1,
3.5.1, 4.7.1, 5.4.1
text................................ 3.3.5.2
plus +
use................................. 2.3, 2.5.1, 3.3.1
text................................ 3.3.4.1
primary'
definition.......................... 3.3.1
procedure
use................................. 2.3, 5.4.1
procedure body'
definition.......................... 5.4.1
procedure declaration'
definition.......................... 5.4.1
use................................. 5
text................................ 5.4.3
procedure heading'
definition.......................... 5.4.1
text................................ 5.4.3
procedure identifier'
definition.......................... 3.2.1
use................................. 3.2.1, 4.2.1, 4.7.1,
5.4.1, 5.5.1
text................................ 4.7.5.4
procedure statement'
definition.......................... 4.7.1
use................................. 4.1.1
text................................ 4.7.3
program'
definition.......................... 4.1.1
text................................ 1
proper string'
definition.......................... 2.6.1
quantity
text................................ 2.7 \f
real
use................................. 2.3, 5.1.1
text................................ 5.1.3
real
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
record variable
text................................ 3.1.3.1, 5.5.3
record variable'
definition.......................... 3.1.1
relation'
definition.......................... 3.4.1
text................................ 3.4.5
relational operator'
definition.......................... 2.3, 3.4.1
repeat
use................................. 4.6.8
repeat statement'
definition.......................... 4.6.8
round
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
scope
text................................ 2.7
semicolon;
use................................. 2.3, 4.1.1, 5.4.1
separator'
definition.......................... 2.3
sequential operator'
definition.......................... 2.3
shares'
definition.......................... 5.5.1
use................................. 5.6.1
share descriptor....................... 5.5.3
shift
use................................. 3.3.1, 3.4.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
sign'
definition.......................... 2.6.1
simple arithmetic expression'
definition.......................... 3.3.1
use................................. 3.4.1
text................................ 3.3.3
simple block head'
definition.......................... 4.1.1
simple boolean'
definition.......................... 3.4.1 \f
simple declaration'
definition.......................... 5
use................................. 4.1.1
simple designational expression'
definition.......................... 3.5.1
simple field'
definition.......................... 3.1.1
use................................. 5.5.3
text................................ 2.8, 5.5.3
simple field declaration'
definition.......................... 5.7.1
simple variable'
definition.......................... 3.1.1
use................................. 5.1.1
text................................ 2.4.3
simple variable field'
definition.......................... 3.1.1
small letter'
definition.......................... 2.1
spaces'
definition.......................... 2.6.1
specification part'
definition.......................... 5.4.1
text................................ 5.4.5
specificator'
definition.......................... 2.3
specifier'
definition.......................... 5.4.1
standard block procedure............... 5.5.7
standard functions and procedures
text................................ 3.2.4
standard procedures
text................................ 4.7.9
statement'
definition.......................... 4.1.1
use................................. 4.5.1, 4.6.1, 4.6.12,
5.4.1
text................................ 4
statement bracket see: begin end
stderror............................... 5.5.7
step
use................................. 2.3, 4.6.1
text................................ 4.6.4.2
statement set'
definition.......................... 4.5.1
use................................. 4.6.8, 4.9.1 \f
string
use................................. 2.3, 5.4.1
string
use................................. 3.3.1
text................................ 3.2.5, 3.3.4.5, 3.3.5.1
string'
definition.......................... 2.6.1
use................................. 3.2.1, 4.7.1
text................................ 2.6.3
string quotes : :'
use................................. 2.3, 2.6.1
text................................ 2.6.3
subscript
text................................ 3.1.4.1
subscript bound
text................................ 5.2.3.1
subscript brackets ()
use................................. 2.3, 3.1.1, 3.5.1, 5.2.1
subscripted variable'
definition.......................... 3.1.1
text................................ 3.1.4.1
subscript expression'
definition.......................... 3.1.1
use................................. 3.5.1
subscript list'
definition.......................... 3.1.1
successor
text................................ 4
switch
use................................. 2.3, 5.3.1, 5.4.1
switch declaration'
definition.......................... 5.3.1
use................................. 5
text................................ 5.3.3
switch designator'
definition.......................... 3.5.1
text................................ 3.5.3
switch identifier'
definition.......................... 3.5.1
use................................. 3.2.1, 4.7.1, 5.3.1
switch list'
definition.......................... 5.3.1
term'
definition.......................... 3.3.1
then
use................................. 2.3, 3.3.1, 4.5.1 \f
true
use................................. 2.2.2
type'
definition.......................... 5.1.1
use................................. 5.4.1
text................................ 2.8
type declaration'
definition.......................... 5.1.1
use................................. 5
text................................ 5.1.3
type list'
definition.......................... 5.1.1
unconditional statement'
definition.......................... 4.1.1
use................................. 4.5.1
unlabelled basic statement'
definition.......................... 4.1.1
unlabelled block'
definition.......................... 4.1.1
unlabelled compound'
definition.......................... 4.1.1
unsigned integer'
definition.......................... 2.5.1
unsigned number'
definition.......................... 2.5.1
use................................. 3.3.1
until
use................................. 2.3, 4.6.1
text................................ 4.6.4.2
upper bound'
definition.......................... 5.2.1
text................................ 5.2.4
value
use................................. 2.3, 5.4.1
value
text................................ 2.8, 3.3.3
value part'
definition.......................... 5.4.1
text................................ 4.7.3.1 \f
variable'
definition.......................... 3.1.1
use................................. 3.3.1, 3.4.1, 4.2.1
text................................ 3.1.3
variable identifier'
definition.......................... 3.1.1
use................................. 4.6.1
while
use................................. 2.3, 4.6.1
text................................ 4.6.4.3
while statement'
definition.......................... 2.6.1
zeroes'
definition.......................... 2.6.1
zone
use................................. 2.3, 5.4.1, 5.5.1
text................................ 5.5.3
zones'
definition.......................... 5.6.1
zone array
use................................. 5.4.1, 5.6.1
text................................ 5.6.3
zone array declaration'
definition.......................... 5.6.1
use................................. 5
zone array identifier'
definition.......................... 3.1.1
use................................. 3.2.1
zone array list'
definition.......................... 5.6.1
zone declaration'
definition.......................... 5.5.1
use................................. 5
text................................ 5.5.3
zone descriptor........................ 5.5.3
zone expression'
definition.......................... 3.1.1
use................................. 3
zone identifier'
definition.......................... 3.1.1
use................................. 3.2.1
zone list'
definition.......................... 5.5.1
zone record............................ 5.5.3
zone segment'
definition.......................... 5.5.1 \f
i
F_O_R_E_W_O_R_D_
Errorlog is an external process used to registrate different kind
of errors.
Errorlog is activated when an internal process sends one or more
messages to errorlog. The message shall point out an area inside
the calling process where the testrecords can be delivered. When
the area is filled, errorlog will return an answer specifying the
number of halfwords delivered.
\f
ii
\f
iii
T_A_B_L_E_ _O_F_ _C_O_N_T_E_N_T_S_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _P_A_G_E_
1. ERRORKINDS ............................................ 1
2. COMMUNICATION WITH ERRORLOG ........................... 2
3. RECORD FORMATS ........................................ 3
3.1 Internal Interrupts and Break 6 .................. 3
3.2 Discerror ........................................ 3
3.2.1 Current Status ............................ 5
3.2.2 Event Status .............................. 5
3.3 FPA Transmission Error ........................... 6
3.3.1 Current Status ............................ 6
3.3.2 Event Status .............................. 7
3.3.3 Start Byte ................................ 7
3.3.4 Status Byte ............................... 8
3.4 Subprocess Error ................................. 8
3.4.1 Subkind, Type ............................. 9
A_P_P_E_N_D_I_X_:
A. REFERENCES ............................................ 11
\f
iv
\f
F_ 1_._ _ _ _ _ _ _ _ _E_R_R_O_R_K_I_N_D_S_ 1.
The following kinds of errors are registrated:
Internal interrupt 0, 1, 2, and break 6 (monitor call break).
Discerror. An abnormal result on a disctransfer will cause
errorlog to generate a record. The record will be generated
before the discdriver takes action to repair the error, e.g.
repair by ecc or repeat the transfer.
FPA transmission error. An abnormal result on a transfer will
cause errorlog to generate a record. As for the disc, the record
will be generated before any actions are taken to repair the
error.
Subprocess error. Errorlog will generate a record if one or more
of the following statusbits are set in an answer (statusbit 0 =
Msb):
Statusbit 1; Parity error
- 2; Timer
- 3; Data overrun
- 4; Block length error (MT)
- 9; Mode error (MT)
- 10; Read error (Card Reader)
- 11; Card reject or disc error.
\f
F_ 2_._ _ _ _ _ _ _ _ _C_O_M_M_U_N_I_C_A_T_I_O_N_ _W_I_T_H_ _E_R_R_O_R_L_O_G_ 2.
Errorlog accepts messages of the following format
19 < 12 + 0
First adr
Last adr
0
First and last adr. must point inside the calling process. The
size must be greater than 76 Hw.
Errorlog copies the records into the buffer.
The message is returned in two cases:
1) when the rest size in the buffer is less than 76 Hw,
2) when copying is rejected maybe because the sender is stopped.
In both cases errorlog will return an answer stating number of
halfwords moved.
It is possible to send several messages to errorlog. The buffers
will be filled and returned one after one.
Although it is an i/o message errorlog allows the message
currently being processed, to be regretted.
In this case number of halfwords will always be zero.
Please note that messages sent to errorlog but not under
processing will cause break 6 if they are regretted.
\f
F_ 3_._ _ _ _ _ _ _ _ _R_E_C_O_R_D_ _F_O_R_M_A_T_S_ 3.
All records have the following fields in common:
+0 Kind; (halfword)
+2 - +8 name of process
+30 - +32 time of record (fetched from the monitor table).
3_._1_ _ _ _ _ _ _ _I_n_t_e_r_n_a_l_ _I_n_t_e_r_r_u_p_t_s_ _a_n_d_ _B_r_e_a_k_ _6_ 3.1
Format
+0 ; Kind=0, 0
+2 - +8 name of internal process
+10; w0
+12; w1
+14; w2
+16; w3
+18; status
+20; IC
+22; cause
+24; SB
+26; (IC-4) ; last two instructions
+28; (IC-2) ; executed
+30; Time1 ;
+32; Time2 ;
A description of the status and cause registers is found in ref.
1.
3_._2_ _ _ _ _ _ _ _D_i_s_c_e_r_r_o_r_ 3.2
An i/o message may be split up in several transfers, each con-
cerning a consequtive group of segments. If one of these trans-
fers is unsuccessful errorlog will generate a record. The pro-
cessname in the record will be the name of the receiver of the\f
message, i.e. the name of the areaprocess the logical disc or the
physical disc. The kind will always be 62.
+0 Kind=62, 0
+2 - +8 name of process
+10; operation, mode of message
+12; first address ; in primary storage
+14; first segment number ; in current transfer
+16; number of segments ; in current transfer
+18; i/o result
+20; remaining characters ; in current transfer
+22; current status
+24; event status
+26; detailed status
+28; process description adr.; of physical discprocess
+30; time1
+32; time2
I/o result is a result generated by the monitor as action on a
received external interrupt or a software timeout. It is inter-
preted as follows:
i/o result 0; normal termination ; interrupt received
1; bus reject, busy ; device not started.(ex.bit23)
2; bustimeout, disconnect; device not started.(ex.bit22)
3; software timeout ; no interrupt received
4; abnormal termination ; interrupt received
5; waitprogram terminated; interrupt received
6; power restart ; software generated
In case of i/o result 1, 2, 3, 6 the halfwords +20 - +26 will be
zero as no status has been delivered from the controller.
In case of i/o result 5 the halfwords +2 - +16 will hold no
relevant information.
I/o result 4 means that an interrupt was received but the last
command executed was not a stop or a wait command.
\f
The standard channel program always contains a sense command. The
current status and event status are formed by logical or of
status from the sense command and the status from the stop
command, e.g. the standard status.
Note that remaining characters are undefined if the read or write
command is not executed.
A detailed description of the status is found in ref. 2.
3_._2_._1_ _ _ _ _ _C_u_r_r_e_n_t_ _S_t_a_t_u_s_ 3.2.1
(bit 0 = Msb)
bit 0 : power low in disc/adaptor
bit 1 : local
bit 5 : seek error
bit 8 : write protect
bit 9 : high density
bit 10 : mode (strobe offset used)
bit 16-23: devicekind = 5
3_._2_._2_ _ _ _ _ _E_v_e_n_t_ _S_t_a_t_u_s_ 3.2.2
bit 0 : intervention (power change)
bit 1 : dataerror (parity error)
bit 3 : data overrun
bit 4 : hard error
bit 5 : position error
bit 20: communication error
bit 21: interrupt error
bit 22: bus timeout
bit 23: bus parity error
\f
3_._3_ _ _ _ _ _ _ _F_P_A_ _T_r_a_n_s_m_i_s_s_i_o_n_ _E_r_r_o_r_ 3.3
Format of record
+0 kind, 0 ; FPA receiver : kind = 86
+2 - +8 NAME of rec/trm process; FPA transmitter : Kind = 88
;
+10 - +16 standard status
+18 - +24 status from first sense
+26 startbyte, statusbyte
+28 process descr. adr.
+30 time
+32 time
+34 - +40 status from second sense
+42 - +74 channel program
The status areas are formatted as follows:
+0 channel progran adr of next command
+2 remaining characters
+4 current status
+6 event status
For details about channel program and status, see ref. 3.
3_._3_._1_ _ _ _ _ _C_u_r_r_e_n_t_ _S_t_a_t_u_s_ 3.3.1
bit 0 : front end disconnected
bit 21: device kind ; receiver : 0 transmitter : 1
bit 23: always 1 : blockoriented device
Remaining bits are zero.
\f
3_._3_._2_ _ _ _ _ _E_v_e_n_t_ _S_t_a_t_u_s_ 3.3.2
bit 0 : reset received from front end (only receiver)
bit 1 : parity error in medium
bit 2 : time out
bit 4 : block length error
bit 21: status transfer error
bit 22: bus timeout
bit 23: bus communication error
Remaining bits are zero.
Before a channel program is started the statusareas will be set
to -1 indicating that status has not been received.
3_._3_._3_ _ _ _ _ _S_t_a_r_t_ _B_y_t_e_ 3.3.3
The startbyte and the statusbyte hold information concerning the
line protocol.
All transfers on the fpaline are opened with a startbyte.
Format of startbyte.
bit 0: blocknumber
bit 4: data follows
bit 5: header bit
bit 6: data flag
bit 7: special function
Special functions are:
1 1 1 1 1 1 1 1 master clear
and 1 1 0 1 1 1 1 1 accept master clear.
\f
3_._3_._4_ _ _ _ _ _S_t_a_t_u_s_ _B_y_t_e_ 3.3.4
All transfers are answered with a statusbyte which specifies the
result of the transmission.
The format of the statusbyte is:
bit 12 : blocknumber
bit 16-17: block control
bit 18 : blocklength error
bit 19 : parity error
Blockcontrol contains acceptance or rejection of a header
received. The field is dummy if the parity bit is set.
The values of blockcontrol are:
0 accepted
1 wait. The operation cannot be received yet due to missing
resources in the frontend
2 skip. The header and data should be cancelled
3 reject. Unintelligible function or line not initialized.
Detailed information about the startbyte and the statusbyte are
found in ref. 4.
3_._4_ _ _ _ _ _ _ _S_u_b_p_r_o_c_e_s_s_ _E_r_r_o_r_ 3.4
Format of record
+0 : kind, subkind
+2 - +8 name of external process
+10 message (1)
+12 - (2)
+14 - (3)
+16 - (4)
+18 answer (1) ; status
+20 - (2) ; characters transferred
+22 - (3) ; halfwords transferred \f
+24 answer (4) ;
+26 - (5) ;
Kind will be 84 or 85 representing a remote link or a local
link.
Subkind holds information about the kind of device represented by
the subprocess.
Information about the format of message and answer is found in
the external process manual representing the current subkind.
3_._4_._1_ _ _ _ _ _S_u_b_k_i_n_d_,_ _T_y_p_e_ 3.4.1
0 ,general sequential device;
4 ,areaprocess ; see ref. 5
6 ,disc ; see ref. 6
8 ,typewriter ; see ref. 7
12 ,papertape punch ; see ref. 8
14 ,lineprinter ; see ref. 9
16 ,cardreader ; see ref. 10
18 ,magnetic tape ; see ref. 11, 12
22 ,diskette ; see ref. 13
\f
F_
\f
F_ A_._ _ _ _ _ _ _ _ _R_E_F_E_R_E_N_C_E_S_ A.
1 RCSL No 42-i1235:
RC8000 Computer Family, Reference Manual
2 RCSL No 30-M43:
DSC801, Disc Storage Controller, Reference Manual
3 RCSL No 52-AA661:
FPA801 Front End Processor Adaptor, Reference Manual
4 RCSL No 31-D496:
FPA Line Control Protocol
5 RCSL No 31-D539:
RC8000 Backing Storage Area Process
6 RCSL No 31-D546:
RC8000 Disc Process (RC36xx)
7 RCSL No 31-D580:
RC8000 Terminal Process
8 RCSL No 31-D534:
RC8000 Paper Tape Punch Process
9 RCSL No 31-D536:
RC8000 Line Printer Process
10 RCSL No 31-D537:
RC8000 Punched Card Reader Process
11 RCSL No 31-D533:
RC8000 Magnetic Tape Process (9-track)
RCSL No 31-D540:
RC8000 Magnetic Tape Process (7-track)
12 RCSL No 31-D542:
RC8000 Cassette Tape Process
\f
13 RCSL No 31-D543:
Flexible Disc Process
\f
\f
i
T_A_B_L_E_ _O_F_ _C_O_N_T_E_N_T_S_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _P_A_G_E_
1. DESCRIPTION ........................................... 1
\f
ii
\f
F_ 1_._ _ _ _ _ _ _ _ _D_E_S_C_R_I_P_T_I_O_N_ 1.
DSF138 is a display feature used in the ELITE 1521B display.
ELITE 1521B is an alphanumeric display used in RC819, RC822B, and
RC828B. Different character sets are available to make different
alphabets.
DSF138 is replacing the normal character ROM and consists of a
standard RC character generator ROA296. The standard RC character
generator is shown in fig. 1, and makes the alphabet known as
EXTENDED DANISH ALPHABET.
Fig. 2 shows the logic diagram for DSF138.
\f
F_
Figure 1: Contents of ROA296. Values 32 to 127 make the "EXTENDED
DANISH ALPHABET". \f
F_
Figure 2: DSF138 Display feature. Circuit diagram. \f
F_\f
«eof»