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

8 ADVANCED PROGRAMMING TECHNIQUES

See Chapter 12

8.1 Store Extracode Operations

(1)

Read block A1 to the operands side of the core store, duplicate it as A2 on the drum, rename block A1 as A3. Release A3 to the drum and lose A2.

(2)

Achieve the sane final result as (1) by any more efficient method.

(3)

A list of numbers extends from location A1 to location A2. A1 is the first word of a block and A2 is the last word of another, higher numbered, block. The list may be of considerable length. It is required to find the sum of the products of pairs of consecutive numbers in the list, and once this is done the list will not be needed again. Program this efficiently. The final result is to be left in location A10 and the possibility of exponent overflow can be disregarded. Set A1, A2 and A10 explicitly for a list containing 512 × P1 numbers.

(4)

100 blocks of main store labelled consecutively A10, A10+1:, ..... A10+99: are processed one at a time starting with A10 and working up to A10+99:. The processing takes about 10 milliseconds and the results for any block, A10+n say, must go to block A11+n, for all n. The original block is not wanted again after A11+n has been filled. Program the process efficiently for a block allocation of 102.

(5)

A bad programmer has abandoned a routine for evaluating sin α for values of α from 0° to 90° with an interval between adjacent values of 0.000175784868°. He has written all these values (in radians) sequentially into 100 blocks of the main store starting at location 10:0. He wishes to overwrite these arguments with sin α. Can you finish his routine using the original list of α's and the store extracodes? The link is to be in B40.

8.2 Branching

(1)

A magnetic tape with programmer's number 1 contains records of the sales of various types of goods stocked by one store of a chain. Each type of article has one 512 word section to itself. The first half-word of each section is 3, which is a code number for the store, and the second half-word is a code word for the type of article.

A second tape, with programmer's number 2, contains corrections of sales information for all stores of the chain, one section being allocated per store for each type of article for which alteration is necessary. The same convention as the first tape is used for the first half-word of each section, which varies according to the store concerned. The remainder of the section, however, is not in the required form and must be processed by a subroutine R5 whose specifications are given below. The second half-word of the processed section will be the same as that of the block it has to replace.

The sections for one type of article on the amendments tape are grouped together, the order of types being the same as that of the sales record tape. The last useful section of the amendments tape is followed by a section with zero in the first half-word.

Write a program, using three branches, to amend the necessary sections of the first tape.

Specifications of R5

a. Link in B90.

b. Operates on one block of information, beginning at 2:

c. Produces a block suitable for transfer to sales tape in block 3:

d.Entry point at first instruction

e. Uses B-registers B10 to B20.

8.3 Monitoring and Trapping (See Chapter 11)

(1)

Arrange that the program jumps to the routine beginning at location A3 when the last item has been read from a data tape.

(2)

Arrange that if a fault occurs the contents of store locations A1+1, A1+2 and A1+3 will be printed out in floating point form to 10 significant digits on separate lines by a private monitor routine which will be entered after printing the type of fault. After the private monitor, terminate the program.

(3)

Write a routine to determine the first integer K, greater than 2, for which sin K > 1-1/K, limiting the routine to no more than 5 seconds by means of the local instruction counter. If the search is successful print K on a newline as an integer on output 0 and exit to the first word of the next block. If the 5 seconds elapses before the first K is found, print "NO K FOUND UP TO" followed on the same line by the value of K at that moment. Then jump to the address held in half-word 74.4.

(4)

Write 20 consecutive blocks, starting at block 40: to tape 4, beginning at the present position of the tape (assuming that this is at the beginning of a block). If tape 4 holds all the blocks, end the program; otherwise, place the remaining blocks on tape 5. Print on a new line on output 0 the number of blocks which overflowed and end the program.

(5)

Information is stored on tape 2 starting at the 1st word of block n (n is stored in B2 in the 21-bit position). Every 10th one of these blocks, beginning with the first, must be read in turn into store block 10: and then processed by routine R4. Arrange to enter label 6 of routine R5 when the end of the tape is reached. Routine 4 is entered at A1/4, with the link in B90.

Answers: 8.1 Store Extracode Operations

(1)

1160 0 0 A1 121 1 0 A2 1163 1 0 A1 121 2 0 A3 1164 3 0 A1 1161 0 0 A3 1167 0 0 A2Read A1Duplicate A1 as A2Release A3Lose A2

(2)

121 1 0 A3 1164 1 0 A1Rename A1 as A3

(3)

A1 = 2: A2 = A1 + (P1 x 512) - 110) +0 121 1 0 0 1160 0 0 A1 172 1 0 (-1P1)x512 224 127 0 2* 1160 0 1 A1+1: 121 2 0 -25520) 324 0 1 A1 362 0 1 A1+1 320 0 0 A10 356 0 0 A10 124 1 0 2 201 127 2 A20 1167 0 1 A1-1: 172 1 0 P1x1: 225 127 0 -4A20Read A1Jump to A21 afterlast blockRead next blockAdd x1xi+1into A10Repeat 256 timesLose used blockRepeat P1 times

(4)

1160 0 0 A10 121 1 0 -100: 121 2 0 A120) 124 1 10 1: 214 127 1 2* 1160 0 1 A10+100: 1164 2 1 A10+99: 1167 0 0 A1 121 3 1 A11+99: 1164 3 0 A2 1161 0 3 0 215 127 1 A20 1167 0 0 A2Read first blockPrepare to renameJump if last passRead next blockRename current block as A1Lose A1A2 becomes A11+99:+b1Release A11+99:+b1Repeat 100 timesLose A2

(5)

121 4 0 -99 121 10 0 A1 121 1 0 0 1160 0 0 10:99) 1164 10 1 10: 214 127 4 2* 1160 0 1 11: 121 2 0 -511 1730 0 2 511A1 346 0 2 511A1 201 127 2 -2* 1161 0 0 A1 121 3 1 10: 1164 3 0 A1 124 1 0 1: 201 127 4 A99 121 127 40 0Block counterSet for renaminga=0Read block 10:Rename 10:+a as A1Jump last timeRead block (11:+a)Replace alpha by sin alphaRelease a1Rename A1 as 10:+aa= a+1:Repeat 100 timesExit

Answers: 8.2 Branching example

[Branch 0] * = 8: 1103 3 0 91D1 121 1 0 0 121 2 0 2: 121 3 0 4: 121 4 0 3 1104 2 0 A14) 1106 2 0 0 215 127 1 A5 1164 2 0 1: 1104 2 0 A1 1101 90 0 A/5 1106 1 0 0 1164 3 0 3: 1104 1 0 A3 121 127 0 A45) 1106 1 0 0 1117 0 0 0 R5 ---- ---- ---- 121 127 90 0 Z [Branch 1]3) 1002 1 0 5: 101 5 0 5:0.4 150 5 0 4:0.4 225 127 0 A3 1006 1 0 0 1004 1 0 4: 1105 64 0 0 [Branch 2]1) 1002 2 0 1: 150 3 0 1: 224 127 0 A2 150 0 0 1: 225 127 0 A1 121 1 0 12) 1105 64 0 0Permit 3 branchesLast block 'switch'Set for renamingGet code numberEnter branch 2Wait for 2Test 'switch'Rename 1:Enter branch 2Enter R5Wait for 1Rename 3: as 4:Enter branch 1Wait for 1Read one blockSet article codeJump to A3 if codewords disagreeBack one sectionWrite block 4:Kill current branchRead one blockLook for store codeLook for endLast block switchKill current branch

Answers: 8.3 Monitoring and Trapping

(1)

1132 0 0 A44) +0 +0 +0 +0 +0 +0 +0 +0 +0 HA3 0

(2)

Near start of program: 1112 0 0 A2 then somewhat later:2) 121 89 0 1:9.3 121 1 0 -2 334 0 1 3A1 1362 0 0 A1/L1 201 127 1 -2* 1117 0 0 0Set private monitor

(3)

1132 0 0 A10 121 127 0 A1110) HA14,0 * = *+13 1) +2 2)+0 3)+111) 1123 0 0 750 324 0 0 A1 320 0 0 A3 356 0 0 A1 1731 0 0 0 356 0 0 A2 1714 0 0 A1 320 0 0 A2 322 0 0 A3 236 127 0 1A11 [The successful case] 121 89 0 10:0.6 1362 127 0 A1/L1 121 0 0 1:*B [The unsuccessful case]13) C NO K FOUND UP TO14) 1065 0 0 2.1 121 1 0 P123 1066 1 0 A13 324 0 1 A1 121 89 0 10:0.4 1362 0 0 A1/L1 101 127 0 74.4Set trapTrapSet 5 sec countK = K+1Sin KPrint K

(4)

1132 0 0 A2 121 1 0 0 1004 4 1 40: 124 1 0 1: 172 1 0 20: 225 127 0 -3* 1117 0 0 0 A2 = * * = 10A2 HA3 0 * = 14A23) 123 81 1 -20: 1004 5 1 40: 124 1 0 1: 172 1 0 20: 225 127 0 -3* 1344 81 0 9 121 88 0 2:0.6 1362 0 0 A2/L1 1117 0 0 0Set trapWrite blockTrap Vector

(5)

1132 0 0 A2 121 3 2 01) 1001 2 3 0 1002 2 0 10: 121 90 0 2* 121 127 0 A1/4 124 3 0 10: 121 127 0 A12) +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 HA6/5 +0 +0 +0Set trap
⇑ 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