procedure outjobtitletimedate(I); value I; integer I;
The procedure outputs on the currently selected stream:-
if I = 1 the Job Title if I = 2 the current time if I = 3 the date.
procedure chain (TAPE, MINBLK, MAXBLK, DEFINEONLY); value TAPE, MINBLK, MAXBLK, DEFINEONLY; integer TAPE, MINBLK, MAXBLK; Boolean DEFINEONLY; procedure callchain (TAPE, MINBLK, MAXBLK); procedure returnchain (TAPE, MINBLK, MAXBLK);
The above procedures allow the user to split up a large Algol program into several sections (called chains) which are complete Algol programs. It is then possible to call one of these chains as a subroutine of another and later return to the calling chain. This facility would, of course, be of little value if there was no means of communicating data values between the two chains. This is achieved by insisting that the outer block declarations for all chains are identical as far as the number of variables of each type, the size of arrays and the ordering of the declarations are concerned. Variables may however be given different names in two chains. The equivalence of names depends on the position of the declaration in the outer block.
A program is defined as a chain by calling the procedure chain from the outer block level of the program. A convenient but not essential position would be the first executable statement of the program. If this is later called from another chain then it would be entered at the statement following the chain procedure call. The first three arguments to the procedure chain define a magnetic tape or disc area numbered TAPE where the program is dumped. It is dumped starting at block MINBLK and the program must not exceed the block MAXBLK. These arguments are very similar to those for the procedure dump program (ICT1). When defining a subchain, once the procedure chain has been called, it is often the case that the program may be terminated. The argument DEFINEONLY, if set to true, will terminate the program and re-enter the compiler. The user could then follow the sub-chain program by a second processor command and a second Algol program. This way all chains of a program can be defined in a single run. Alternatively if DEFINEONLY is false, the program continues executing once the chain has been defined. This would normally be used after defining the main program.
To enter one chain from another, the procedure call chain is called giving the position where the chain to be called is defined. The original chain can be returned to by calling return to chain. The arguments, in this case, give the position where the original chain is stored.
It is possible for sub-chains to call other sub-chains as long as a chain is not called recursively.
An example of a program defining two chains on tape 1 is as follows:
JOB I0000 HOPGOOD TEST CHAIN CALLING TAPE 1 N0000YOURTAPE~~PERMIT ....... COMPILER ALGOL INPUT INTERNAL ICT WITH ICT I/O PROCEDURES. LIST ON LINEPRINTER; begin
real a,b,c; integer d,e,f; chain (1 ,1,40,true); a:=a+2; b:=b+3; d:=1; return to chain(1,41,80); end INPUT INTERNAL ICT WITH ICT I/O PROCEDURES. LIST ON LINEPRINTER; begin
real ap,bp,cp; integer d,e,f; chain (1,41,80,false); ap:=3; bp:=2; d:=4; call chain (1,1,40); print (ap,2,0); print (bp,2,0); print (d,2,0); end ***Z
This program would print the results
5 5 1
It may be of interest to note that the I/O package used in each chain need not be the same. Complications could arise, however, if the Elliott I/O package was used in only one chain as the declaration:
array location [location : location];
is inserted at the top. It would be necessary to insert a dummy declaration:-
array location[1 : 1];
in the other chain not using the Elliott I/O package.
procedure call algol;
This procedure, when called, will cause the Algol compiler to be re-entered ready to compile another Algol program. The program will be expected on the currently selected input stream which should be in internal code mode and have a processor command on the next line to be read.
procedure dump program(TAPE, MINBLK, MAXBLK); value TAPE, MINBLK; integer TAPE, MINBLK, MAXBLK;
This procedure is similar to the standard dump program procedure, ICT1 but more efficient on reading down. Unlike the standard procedure, the directory block is stored at MINBLK rather than MAXBLK and it is followed by the blocks of the program. The variable MAXBLK contains the last block used on exit from dump program. The procedure uses the block *17 to read down the directory. The standard means 0 entering the dumped program is therefore:-
COMPILER ABL 1001, TAPE, 0, MINBLK 1002, TAPE, 0, J17 121, 127, 0, J17 EA
where TAPE is the number allocated in the Job Description for the tape containing the dumped program and MINBLK is the starting block for the dumped program.
The procedure is shorter than the standard procedure. It also remembers which I/O streams were selected when the program was dumped. It does not print anything on program dumping unless the program is longer than the space allocated. In this case the diagnostic
DUMP SPACE EXCEEDED
is issued.
This procedure was provided by J. Bailey. Further details are given in Chapter 15 of the Atlas Algol System manual.
procedure lower triangle iliffe vectors (A);; array A;
This procedure enables a symmetric matrix of order N to be stored in a total of 0.5N (N + 1) words, while still treating the matrix as a two dimensional array. When referring to an element A[I,J], the condition J ≤ I must be satisfied, and the array A should be declared as A[1:N, 1:0.5 *(N + 1.1)]. The procedure modifies the Iliffe vector accessing the array elements and must be called before any elements the array are used.
This procedure was provided by J. Bailey.
procedure interpret(I); value I; integer I;
This procedure is designed for people with a good understanding of Atlas machine code. It switches a program from running normally into a state where the program is interpreted one instruction at a time and relevent information about changes in registers and storage locations is printed. The interpreter is stored on the disc area R072 INTERPRET. The disc area must be defined in the Job Description and the number allocated must be the same as the one given as the argument I to the procedure. Each instruction obeyed generates a line of print consisting of:-
The value of the modified address or immediate operand if applicable.
This is written as N = ........ for an immediate instruction and S' = ......... for an address.
Fuller details of the output are given in the write-up 'FOOTPRINTS' by W F Lunnon, Manchester University (Jan. 1967). The procedure interpret is a simplification of this very comprehensive system. The interpreter uses B51 and care must be taken not to destroy its value. In addition the interpreter is read down into blocks *0773 to *0776 and these cannot be used by the Algol program (no standard Algol program uses these blocks).
integer procedure array offset (A); array A; procedure to tape (I,A); value I; integer I; array A; procedure from tape (I,A); value I; integer I; array A; procedure move tape (I,J); value I, J; integer I, J;
These procedures allow the user to transfer information between the array A and magnetic tape or disc using fixed block 512 word transfer This is the most efficient method of storing and retrieving information from backing devices. As the array A will be stored in the program's stack of variables, it is unlikely that the base of the array A will be situated at a page boundary (all fixed block transfers must occur from and to 512 words starting at a page boundary).
Therefore to define an area of the array A coincident with a page of Atlas store, the user should define array A as
array A [1:1024];
then S: = array offset (A); will define the element of the array A which starts an Atlas page. The elements A[S] to A[S+511] will take part in the fixed block transfer.
The procedure totape will transfer the contents of the locations A[S + 1] to A[S + 512]to the next block on tape or disc given the number I in the Job Description. Similarly the procedure fromtape will read the next block of tape or disc I into the array positions A[S + 1] to A[S + 512].
The procedure move tape will reposition tape I to point to block J. The first block of tape is given the position 1 so that:-
movetape (I, 1)
is equivalent to the rewind operation.
procedure fast char print routine;
When called, this procedure replaces the standard output routine by one which is 2.5 times faster. All printing normally involves adding characters to a buffer. This allows composite characters to be output but does involve a certain amount of inefficiency. The fast routine cannot handle multiple characters or outer set characters but it does permit the user to freely intermix output from the standard procedures and output generated in code procedures by extra code. A further call of the procedure will result in a return to the original character printing routine. This procedure was provided by J. Bailey.
procedure chain (TAPE, MINBLK, MAXBLK, COMPILER); value TAPE, MINBLK, MAXBLK, COMPILER; integer TAPE, MINBLK, MAXBLK, COMPILER; procedure call chain (TAPE, MINBLK, MAXBLK); procedure return to chain (TAPE, MINBLK, MAXBLK); procedure claim chain (TAPE, MINBLK, MAXBLK);
These procedures are derived from the original ICT38. They are slightly more restrictive than ICT38 but also more efficient.
The procedure chain defines an Algol program as a chain and stores it on tape TAPE between blocks MINBLK and MAXBLK. If the variable COMPILER is set:-
< 0 then the job terminates = 0 then the chain just defined is executed > 0 then calls compiler with number COMPILER
for example
2 will call down ABL 12 will call down ALGOL 19 will call down SERVICE 29 will call down SPECIAL
The original procedure return to chain would redefine the currenit program on tape before bringing down the new chain. The new procedure assumes that the program itself has not been modified (this could only be done by code procedures) so that the program itself need not be re-stored before entering the new chain. Similarly call chain assumes that the program has not been modified during execution and so only stores local variables and constants before entering the new chain.
The final procedure claim chain has been defined for use when you are initially not in a chain at all or alternatively never wish to return to this chain. The new chain is brought down and entered. No information about the original chain is stored.
These procedures have been thoroughly tested and are recommended in preference to ICT38. They do not have some of the limitations ICT38 which arise when using different I/O packages in different chains. These procedures were provided by J. Bailey.
procedure elegant output; Boolean procedure near bottom of page;
These two procedures are designed to produce output which fits nicely onto computer output pages. It incorporates the fast print routine, ICT44, and has the same restrictions. After elegant output has been called, the output passes through a modified output routine which:-
Consequently each output page consists of 38 lines of output centred on the page. The procedure uses B66 as a line count and works on the assumption that output is being produced for one output stream at a time.
The procedure near bottom of page gives an answer true if more than 35 lines of output have been generated on the current page. These procedures were provided by J. Bailey.
This contains the procedures layout, inlogical and outlogical. Their definitions are identical to the procedures format, read boolean and write boolean in the KDF9 I/O package. They are required when running EGDON KDF9 dialect programs on Atlas. Full details are given in section (xii) of Chapter 4.3 of the Atlas Algol System manual.
real procedure elapsed time;
The result of this procedure is the time used in seconds since the program started running. This includes time spent in compilation.