Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ ContentsIntroduction0. Introductory exercises1. Basic operations2. Modification, counting and testing3. B-register operations4. Accumulator operations5. Extracode functions6. Input and output operations7. Magnetic tape operations8. Advanced programming techniques9. Complete programs
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureAtlas manualsABL Exercises :: ATLAS 1 COMPUTER ABL PROGRAMMING EXERCISES
ACLLiteratureAtlas manualsABL Exercises :: ATLAS 1 COMPUTER ABL PROGRAMMING EXERCISES
ACL ACD C&A INF CCD CISD Archives
Further reading

Contents
Introduction
0. Introductory exercises
1. Basic operations
2. Modification, counting and testing
3. B-register operations
4. Accumulator operations
5. Extracode functions
6. Input and output operations
7. Magnetic tape operations
8. Advanced programming techniques
9. Complete programs

9 COMPLETE PROGRAMS

9.1 Example using Fixed Length Tape Transfers

1,000 blocks of information are stored starting at section 1 of tape number E712 which has the title F77 RESULTS OF EXPERIMENTS. This information is to be processed by the computer, each block of information producing one block of results which are to be written to tape number E340, which has the title 1F211 PROCESSED RESULTS.

The processing is done by a subroutine R3, entered at the first instruction, which requires a link in B90. In processing block n, R3 uses the results of processing block (n-1) and it requires block n to begin at A3 and the results from (n-1) to begin at A3-1:. For processing block 1, block (A3-1:) must be filled with floating point zeros. The results produced will overwrite the information in block A3.

Processing one block will take approximately 1/10th of a second.

Sketch a flow diagram which will use the tapes as efficiently as possible and draw up the complete program document required, leaving a space for R3.

9.2 Example using Variable Length Tape Transfers

A magnetic tape with title number F2017 and title F123 VARIABLE LE1TGTH RECORDS/JKB/40 contains information written in variable length strings. The first half-word of each string is a keyword to identify the information which follows.

It is necessary to replace some of these strings by amendment strings which are on a magnetic tape with number H107 and title F123 AMENDMENTS/JKB/40. The keyword of each string on this tape corresponds to that of the string which it must replace. There is no guarantee that the amendment string is the same length as the string which it has to replace.

All strings are less than 100 words in length and are separated by a '1' marker. The information on each tape begins and ends with a '2' marker.

Write a complete program to carry out the amending leaving the final result on a tape with serial number H993 and title F123 VARIABLE LENGTH RECORDS/JKB/41, and draw up the necessary job description as a separate document.

9.3 Example using Complex Extracodes

If z0 is a first approximation to one of the roots of the complex polynomial f(z), then usually a better approximation, z1, is given by

z1 = z0 - f(z0) / f'(z0)

Write a program to find that root of the polynomial

f(z) = (z - l)(z - 2)(z - 5)

to which the iterative process leads if

z0 = 3.5 + i100

Print at each stage the value of current approximation (real and imaginary parts) and the value of |f(z)|. Stop the process when

|f(z)| is less than 10-8.

Answer: 9.1 Example Using Fixed Length Tape Transfers

START POSITION TAPE READ BLOCK TO A3 READ BLOCK TO A3+1: R3 FIRST CYCLE? NO YES SHIFT A3-1: TO A3-2: WRITE A3-2: TO TAPE SHIFT A3 TO A3-1: SHIFT A3+1: TO A3 999TH CYCLE? YES NO R3 WRITE A3-1: TO TAPE WRITE A3 TO TAPE STOP
JOB F5122, RESULT PROCESSING TAPE 1 E712 F77 RESULTS OF EXPERIMENTS TAPE 2 E340 F211 PROCESSED RESULTS COMPUTING 130 SECONDS COMPILER ABL A3 = 4:2) 1002 1 0 A3 121 1 0 998 121 2 0 A3-2: 121 3 0 A3-1: 121 4 0 A31) 1002 1 0 A3+1: 1362 0 0 A/3 170 1 0 998 224 127 0 3* 1164 2 0 A3-1: 1004 2 0 A3-2: 1164 3 0 A3 1164 4 0 A3+1: 203 127 1 A1 1362 0 0 A/3 1004 2 0 A3-1: 1004 2 0 A3 1117 0 0 0 R3 ----- ----- ----- 121 127 90 0 Z EA2 ***ZRead block 1 to A3Count of blocksPreparefor renamingRead a block to A3+1:Jump on first passA3-1: becomes A3-2:Write A3-2: to tape 2A3 becomes A3-1:A3+1: becomes A3Write A3-1:Write A3

Note: The program begins in block 1: (since there is no star directive to say otherwise) and the block from which the results are written to tape is block 2: (=A3-2:). This means that if R3 is not to be overwritten it must not extend into block 2:.

Answer: 9.2 Example Using Variable Length Tape Transfers

START POSITION TAPES SET UP BUFFERS READ ONE STRING FROM AMEND FILE KEYWORD = a READ ONE STRING FROM B/F FILE KEYWORD = b TEST a = b? YES NO WRITE FROM AMEND TO C/F TEST FOR END OF AMEND FILE NO A8 YES RELEASE AMEND BUFFER MARK WITH A "1" TEST FOR END OF B/F FILE NO A5 YES MARK WITH A "2" STOP WRITE FROM B/F TO C/F TEST FOR END OF B/F FILE NO A5 YES STOP
COMPILER ABL F123/JKB MONTHLY UPDATE A2 = A1+100 A12 = (A2 + 1:100)B + 0.16) 1030 2 0 A12 1030 1 0 A12+2: 1032 3 0 A12+4: 1042 0 0 0.28) 1033 2 0 0 121 3 0 100 1040 3 0 A25) 1033 1 0 0 1040 2 0 A1 101 10 0 A1 102 10 0 A2 1033 3 0 0 214 127 10 A7 1040 2 0 A1 210 127 2 A5 1117 0 0 07) 1040 3 0 A2 210 127 3 A8 1043 2 0 0 1042 0 0 0.1 210 127 2 A5 1042 0 0 0.2 1117 0 0 01) EA6 ***Z JOB F123/JKB UPDATE TAPE 1 F2017 F123 VARIABLE LENGTH RECORDS/JKB/40 TAPE 2 H107 F123 AMENDMENTS/JKB/40 TAPE NEW 3 H993 F123 VARIABLE LENGTH RECORDS/JKB/41 INPUT 0 F123/JKB MONTHLY UPDATE STORE 9 BLOCKS COMPUTING 10 SECONDS ***ZSet up read andwrite buffersWrite "2" markerSelect amendmentsRead next amendmentSelect B/F tapeRead from B/F tapeSelect C/F tapeWrite B/F recordJump if "1"STOP (write "2")Write to C/FJump if odd markerClose down amendmentsMark with "1"Mark with "2"

Note: B/F and C/F stand for Brought Forward and Carry Forward.

Answer: 9.3 Example using Complex Extracodes

JOB F5006/COMPLEX NEWTON COMPILER ABL1) +1, +0, -8, +0, +17, +0, -10, +02) +3, +0, -16, +0, +17, +04) +3.5, +1005) +0. +06) +0, +09) +1 (-8)11) +022) 1424 0 0 A1 121 1 0 020) 124 1 0 2 1462 0 0 A4 1420 0 1 A1 172 1 0 6 225 127 0 A20 1456 0 0 A5 121 89 0 10:10.2 324 0 0 A4 1362 0 0 A1/L1 121 89 0 10:10 324 0 0 1A4 1362 0 0 A1/L1 1412 0 0 A5 356 0 0 A11 1362 0 0 A1/L1 324 0 0 A11 321 0 0 A9 236 127 0 2* 1117 0 0 0 1424 0 0 A2 121 1 0 021) 124 1 0 2 1462 0 0 A4 1420 0 1 A2 172 1 0 4 225 127 0 A21 1456 0 0 A6 1414 0 0 A6 1462 0 0 A5 1456 0 0 A6 1424 0 0 A4 1421 0 0 A6 1456 0 0 A4 121 127 0 A22 EA22/0 ***ZCoeff. of FCoeff. of F'ZFF'EPSMOD Fcompute f(z)print zprint mod fcomparecontinuecompute f'(z)compute new z
⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site