Magnetic tape provides an auxiliary store of very large capacity. For many purposes, a magnetic tape can be regarded as a larger but slower form of main store, but it is subject to tho restriction that it must be scanned sequentially. It can perhaps best be likened to a notebook whose pages must be turned slowly one at a time: it is possible to ignore a page but it is still necessary to turn it over, and this takes as long as reading it. When using magnetic tape, it is therefore necessary to ensure that the information on the tape is arranged in the order in which it will be required.
Atlas uses two types of magnetic tape, of one and of half inch widths. The system tapes, and most tapes for private use, are one inch wide, pre-addressed tapes, which may be used for fixed or variable length transfers. Reading from the tape is possible in both forward and backward directions. The half inch tape is not pre-addressed, and can only be read forwards: transfers are all variable length. One inch tapes prepared on the I.C.T. Orion computer may also be read.
To make efficient use of magnetic tape, it is necessary to overlap magnetic tape transfers and computing as far as possible. This requires care in the timing of transfers and the allocation of storage space when direct transfers to tape are employed. The programmer is, however, relieved of this responsibility when using the extracodes for variable length tape transfers, because these interpose a buffer store between the program and the tape.
Within a program, each magnetic tape is identified. by a number. This number, B, is normally written in the Ba digits of an instruction and lies in the range 0 ≤ B ≤ 99. The tape number, B, is normally allocated to the appropriate tape by the Job Description, which will be described in Chapter 10.
Information on each magnetic tape is split up into sections of 512 words. There are 5000 sections on each full-length magnetic tape, and these are numbered from 0 at the beginning of the tape to 4999 at the end. Section 0 is reserved for special purposes, and when a tape is first mounted it is positioned ready to move forwards and use section 1. Normally a program will first use the tape starting at section 1. Later it may require to return to section 1 or go on to some other section, and it must then obey a search instruction. The instruction
1001 Ba 0 n
will search for the beginning of section n on tape number Ba prior to fixed length transfers. Thus, to search for section 8 on tape 4, we would write
1001 4 0 8
The 1044 extracode must be used for a search before variable length transfers (see below).
Searching tape is a relatively slow process compared with the computing speed of Atlas, and the time taken is proportional to the number of sections traversed. Therefore the information on tape should normally be stored in consecutive sections starting at section 1, and any search instructions should be given as early as possible in the program.
In this chapter it will sometimes be necessary to refer to blocks of store. On Atlas, a block is a unit comprising 512 words of main store; block number P contains the 512 words whose addresses are 512P to 512P + 511. The store structure will be explained in chapter 12 but this simple definition should suffice for the present.
All magnetic tape instructions are singly modified, and throughout this chapter references to the address of an instruction apply to the modified address N + bm. The tape number is normally written in the Ba digits, but if Ba = 122 the tape number is specified by b121.
Block transfer instructions allow a program to transfer 512-word blocks of information between a magnetic tape and a specified block of store. To obtain maximum efficiency in using magnetic tape, a program should use these block transfer instructions and make its own provision for the overlap of tape transfers and computing.
The section search instruction, 1001, described in section 9.2, may be used to position the tape before block transfer operations. An instruction of the form
1002 Ba 0 P:
would then read the next 512-word section from tape Ba into block P.
In the block transfer instructions, the octal fraction of the address is used as a parameter K, 0 ≤ K ≤ 7, where K + 1 specifies the number of blocks involved in the transfer. Thus, to read the next two sections from tape 4 into blocks 5 and 6, we would write
1002 4 0 5:0.1
The block transfer instructions are as follows:-
Function | Description |
---|---|
1001 | Search for the beginning of section n on tape number Ba |
1002 | Read the next K + 1 sections from tape Ba into store blocks P, P + 1, ..., P + K. |
1003 | Read the previous K + 1 sections from tape Ba into store blocks P + K, ..., P + 1, P. |
1004 | Write store blocks P, P + 1,..., P + K on to the next K +1 sections of tape Ba. |
1005 | Move tape Ba forwards K + 1 sections. |
1006 | Move tape Ba backwards K + 1 sections. |
When reading either forward or backward, information will be held in store in the same order as on tape, with the first word in the lowest numbered tape section transferred to the start of the store block with the smallest address. This order of words is also maintained when writing to tape.
Examples:
1. Read section 19 of tape 3 to main store block 6.
a) 1001 3 0 19 Search for section 19 1002 3 0 6: Read forward to block 6 b) 1001 3 0 20 Search for section 20 1003 3 0 6: Read backward to block 6
The information in block 6 will be the same in either case.
2. Read sections 1, 3, 5, 7 and 9 of tape 66 into main store blocks 20 to 24 inclusive. The previous operation on tape 66 was to write to section 13.
1006 66 0 0.2 Position tape after section 11 121 1 0 4: Set block modifier 1) 1006 66 0 0 Move tape back 1 section 1003 66 1 20: Read previous section 123 1 0 1: Reduce block modifier 216 127 1 A1 Return if non-negative
A considerable saving is obtained in this example by reading backwards. To have searched for section 1 and read forwards would have meant traversing nine sections twice and would have taken almost twice as long.
The instructions have been arranged so that the 1006 instruction comes before the 1003 instruction in the loop. If the 1003 instruction had been put first, the program would have traversed one extra section after the last read instruction; in this particular program the extra section would have been section 0 and the program would have been monitored because the use of section 0 is prohibited.
The way in which a program uses magnetic tape will depend very much on the requirements of the process it is performing. Sometimes it is necessary to read a large amount of information, such as a complete matrix, before computing can commence. In this case, shortage of store may prevent the overlap of computing with further tape reading, but at least the next required tape address can be searched for; afterwards it may be possible to overlap the writing of the results to one tape with the reading of the next set of data from another. The technique of branching, to be described in chapter 12, may also help in this situation.
When it is possible to work sequentially through the information on tape, operating on one word or one small group of words at a time, considerable savings can be made by overlapping tape transfers with computing. This is done automatically by the variable length transfers (see below). With block transfers, overlap can be obtained by transferring alternately to two different blocks, computing on one whilst transferring to the other.
The same process can be used when operating on two or more magnetic tapes. When processing longer items, special care is needed if an item overlaps two tape sections.
Example:
To read sections 1 to 2000 of tape 4, presenting each word to a processing routine R3, a control program of the following form would suffice:
R0 ASSUMED 1001 4 0 1 Search for section 1 1002 4 0 5:0.1 Read to blocks 5 and 6 121 71 0 511 Set word count 121 72 0 1999 Set section count 121 127 0 A4 Jump to label 4 2) 124 2 0 1 Step up address 203 127 71 A1/3 Count words in block 121 71 0 511 Reset word count 203 127 72 *2 Count tape section 121 127 0 A5 Exit 1002 4 2 -1: Read to refill block just emptied 203 127 73 A1/3 Count blocks 4) 121 73 0 1 Set block count 121 2 0 5: Set first block address R3 1) 324 0 2 0 Read word ................ Process word 121 127 0 A2/0 Return to R0 for next word
In the preceding example, because it is reading two sections in advance, the program reads one section more than it requires, but does not attempt to process the extra section. This extra read operation could be avoided by an extra test in the example, but it would be unavoidable if the end of the process were detected by the processing routine on receipt of the last word. There is normally no harm in reading extra sections provided that they do not lie outside the range 1 to 4999 inclusive, and provided that these extra sections have been written to since the tape was last addressed. It is therefore advisable to write a few extra sections after the information when a tape is written to. A magnetic tape fault (512-word fault) will show up if an attempt is made to read from a section not previously written to.
To simplify the writing of some magnetic tape programs, extracodes are provided which execute the transfer of variable length records between magnetic tape and the main store. Variable length operations must initially be preceded by the variable length word search. The instruction
1044 Ba 0 S
will search tape number Ba for the section and word contained in the full word with address S. The section number is contained in the more significant, and the word number in the less significant half word, both being held as 21 bit integers. Thus, to search for the eighth word of section 10 on tape 4, we would write
1) H10 8 1044 4 0 A1
The 1001 search may not be used with variable length working.
The extracodes for variable length operations require an area of store to be used as a buffer, to hold information in transit between the tape and the store. This buffer must be set up, and the mode of operation specified, by obeying a start extracode for each tape involved in variable length operations. Thereafter, a transfer extracode is used to transfer information between the buffer and the program as required. When writing to tape each such transfer forms one record on the tape.
Before writing variable length records to magnetic tape, it is necessary to obey a 1032 instruction. This start writing instruction normally takes the form:
1032 Ba 0 P:0.K
This prepares for writing forwards starting at the next word on tape Ba, and selects it for variable length operations. It also sets up a buffer store in blocks P to P + K inclusive; normally K = 1, allowing a two block buffer. Thus, to start writing variable length records to tape 5, using main store blocks 10 and 11 (locations 5120 to 6143) as buffer, we would write
1032 5 0 10:0.1
Thereafter, information may be transferred to tape 5 by 1040 instructions. Before obeying a 1040 instruction, when writing to tape, the number of words to be transferred and the end-of-record marker must be set in an index register: the number in the integral part and the marker in the octal fraction. This index register must then be specified in the Ba digits of the 1040 instruction. Normally, the end of an ordinary record should have a marker of value 1. Thus, using B6 to specify a transfer of 25 words, we would write
121 6 0 25.1
To transfer 25 words (as specified in B6) starting at address 2000, we would then write
1040 6 0 2000
Example:
Given a 30 × 100 matrix stored by rows in location 8000 onwards. Write the 30 rows, of 100 numbers each, as 30 separate records starting at the beginning of section 8 on tape 4.
1)H 8 1044 4 0 A1 Search for section 8 1032 4 0 10:0.1 Start Writing to tape 4 121 1 0 29 Set row count 121 2 0 0 Clear modifier 121 3 0 100.1 Prepare to transfer 100 words 5) 1040 3 2 8000 Transfer 124 2 0 100 Increase modifier 203 127 1 A5 Count rows
Before reading variable length records from tape, it is necessary to obey a start reading instruction. To start reading forwards, a 1030 instruction must be used, and this normally takes the form
1030 Ba 0 P:0.K
This starts reading forwards from the next word on tape Ba and selects it for succeeding variable length operations:. It also sets up a buffer in blocks P to P + K inclusive; normally K = 1, giving a two block buffer. Thus, to start reading variable length records from tape 5, using main store block 10 and 11 as buffer, we would write
1030 5 0 10:0.1
Thereafter, information may be transferred from tape 5, reading forwards, by using 1040 instructions. The Ba digits of the 1040 instruction indicate which index register has been used to specify the amount of information to be transferred. When reading from tape, this index register normally specifies the maximum number of words to be transferred. It may also specify an end-of-record marker whose purpose will be explained later. The number is specified by the integral part, and the marker, if required, by the octal fraction.
To read one record at a time, the maximum length of record should be specified and the marker should be zero (or one). After the transfer, the same index register records in its integral part the number of words actually read, and in its octal fraction the value of the marker at the end of the record. Thus, to read a record of not more than 200 words to location 1500 onwards, we would write
121 10 0 200 1040 10 0 1500
If the actual record were of 100 words terminated by a marker 1, then B10 would contain 100.1 after the transfer.
Thus, to read to location 200 the first row of the matrix recorded on section 8 in our previous example, we would write:
8)H 8 0 1044 4 0 A8 Search for section 8 1030 4 0 10:0.1 Start Reading from tape 4 121 3 0 100 Prepare to read up to 100 words of next record 1040 3 2 200 Transfer
When reading, it is possible to ignore end-of-record markers of less than a given value by specifying that value in the octal fraction of Ba before the transfer. Thus, for example, by setting 300.2 in B3 before the 1040 instruction above, we could read the first 300 elements of the matrix; the marker 1 written at the end of each row is less than the octal fraction 2 set in B3 and would therefore be ignored.
The instructions to start reading or writing assume the tape to be positioned at a marker, either by previous variable length operations or word search.
So far we have only considered working on one magnetic tape at a time, and in this case the start instruction selects that tape for all succeeding tape operations. When working on two or more tapes, it is still necessary to use start instructions to initiate variable length working, but subsequently 1033 instructions must be obeyed to select whichever tape is required. This select instruction chooses tape number Ba for succeeding variable length transfers until the next select or start instruction.
Example:
Tape number 2 contains a file of variable-length records starting at section 1. Each record is terminated by a marker 1, except the last record which is terminated by a marker 2. The maximum length of record is 50 words. Copy the file to tape 3, section 1 onwards.
2)H 1 0 1044 2 0 A2 Search for section 1, tape 2 1044 3 0 A2 Search for section 1, tape 3 1030 2 0 10:0.1 Start Reading from tape 2 1032 3 0 12:0.1 Start Writing to tape 3 1) 1033 2 0 0 Select tape 2 121 4 0 50 Read next record to location 1040 4 0 A6 A6 onwards 1033 3 0 0 Select tape 3 1040 4 0 A6 Write record 210 127 4 A1 Jump if marker odd, End if marker even
In the previous section, a selection of the most important variable length magnetic tape instructions have been described and illustrated in order to explain how they are used. In this section, the full range of variable length tape instructions will be defined, and there will be some repetition of information from the previous section.
When using variable length tape transfers, the information is stored on tape in groups of words known as records, with a 21-bit count and a 3-bit marker on each side to denote the ends of the record. Thus the space on tape occupied by a record is one word more than the number of words of information. Each writing transfer forms one record on tape. A reading transfer may either read a specified number of words or read up to the end of a record; in both cases markers are omitted from the transfer. Instructions to start reading or writing must only be given when the tape is positioned at a marker.
A number of consecutive records often form a larger unit, such as a complete matrix or a complete file, and it is often desirable to mark this in some way. For this reason eight orders of marker, numbered 0 to 7, are provided. Ordinary records may be terminated by a marker of order 1, groups of records by a marker of order 2, and so on up to 7, which normally denote: the beginning or end of a file. Reading transfers may then read up to a marker of a specified order, and the program may test the value of the marker read. Use of the 0 marker is not recommended.
Variable length working must always be initiated by a start instruction. This sets up a buffer store, selects the tape to be operated upon, and specifies the mode of operations, whether write, read forwards or read backwards. A separate start instruction must be given for each tape on which variable length transfers are required, but thereafter a select instruction may be used to choose the tape to be used. The transfer instruction operates on the tape which was last selected by a start or select instruction, and transfers information in the mode selected for that tape. To change the mode it is necessary to obey another start instruction. Unless the tape is already in variable length mode, the instruction to start writing begins by writing a marker of order 7. To start writing without commencing with a 7 marker, the sequence Word Search, Start Reading Forwards, Start Writing, Transfer should be used. Alternatively, the 1042 mark instruction may be used after the instruction to start writing.
A start instruction always initiates variable length transfers to or from the next word on tape or the previous word in the case of reading backwards. To begin working at a particular address on tape, the start instruction must be preceded by the word search instruction, 1044; when starting to read variable length records, this starting address must be the address of a marker at one end of a record.
The variable length writing operations do not provide a means of overwriting selected words on a magnetic tape: complete new blocks are formed in the buffer and the previous contents of the tape are not preserved. If it is required to preserve the beginning of the first section, this may be done by preceding the start writing instruction by a start reading forwards instruction with K=0.
It is important to note that, when using a buffer of K+1 blocks, the attempt to read variable length records backwards from any of the first K sections, or forwards from any of the last K sections, will lead to an end-of-tape interrupt. K sections should therefore be left unused at both ends of the tape.
In the following specifications, P is a block address, and K an octal fraction, as above.
Function | Description |
---|---|
1030 |
Start Reading Forwards
Start reading forwards from the next word on tape Ba and select it for variable length operations. Set up a buffer in blocks P, P+1,:..., P+K. If this instruction is given when the tape is already in read forwards mode, then the tape will be wrongly positioned. |
1031 |
Start Reading Backwards
Start reading backwards from the previous word on tape Ba and select it for variable length operations. Set up a buffer ir blocks, P, P +1, ..., P + K. |
1032 |
Start Writing Forwards
Prepare to write forwards starting at the next word on tape Ba, and select it for variable length operations. Set up a buffer in blocks P, P + 1, ..., P + K. Also, write a marker 7 before the first word of information, provided that the given tape is not already in use for variable length working. If the tape is already in use for variable length working, the marker written will be equal to the marker at the end of the previous record. |
The three start instructions 1030, 1031 and 1032 must be preceded by a 1044 word search, even when the desired word is the first in the section. To give predictable results, the tape must be positioned at a marker whenever a start instruction is used. The K+1 block buffer must have been allowed for in the job description (see Chapter 10). If one of these blocks is already in use by the program, the information in it will be lost. Strings of information with markers at either end are transferred to and from these blocks by the 1040 instruction. When a buffer block has been filled in the writing mode, it is transferred to tape; when completely read in the reading mode, the next section is read from tape. The buffer blocks are not protected from the program, but should not be referred to directly.
It may be desirable to read variable length records from a tape for a while, and then begin writing to the very next record. 1032 will switch modes in this way; the first record written will begin with the same marker as that terminating the previous record.
Function | Description |
---|---|
1033 |
Select
Select tape Ba for succeeding variable length operations, in the mode specified by the preceding start instruction for the tape. All succeeding 1040, 1041 and 1042 instructions apply to tape Ba until another tape is selected. If a write buffer had previously been set up for tape Ba, its contents will be written to tape, and a new buffer set up. Records will be written as if tape Ba were selected throughout. |
Extracodes 1030 and 1031 above assume that the tape to be read from has been previously written by variable length operations. If this is not the case, the extracodes 1034 and 1035 should be used instead.
Function | Description |
---|---|
1034 |
Start Reading Forwards From Fixed Blocks
As 1030, but operating on a tape which has not been written in the form of variable length records. |
1035 |
Start Reading backwards From Fixed Blocks
As 1031, but operating on a tape which has not been written in the form of variable length records. |
Notation:
bw = Integral part of ba (bits 1 to 20) (0 ≤ bw < 219)
bk = Octal fraction of ba (0 ≤bk ≤ 7)
Function | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1040 |
Transfer Transfer up to bw words between store addresses starting at S and the selected tape, in the mode (reading forwards, reading backwards, or writing) appropriate to that tape, On writing, bw words from locations S, S + 1, ..., S + bw - 1 are written to the next bw locations on the selected tape. A marker bk is written on tape after them. On Reading, provided that bw ≠ 0, the transfer continues until bw words of information have been read or until a marker ≥ bk is encountered, whichever is the sooner. bw' = the number of words of information actually read. bk' = 0 if no marker ≥ bk was encountered. bk' = m if a marker m (≥ bk) terminated the transfer or immediately followed the last word transferred. When reading forwards, the next bw' words are read from tape to store locations S, S + 1, ..... S + bw' - 1. When reading backwards, the previous bw' words are read from tape to store locations S, S - 1, ...... S - bw' + 1. If bw = 0 when reading forwards, the transfer continues until the first marker ≥ bk is encountered. When reading backwards with bk and bw zero, the transfer continues until the end of the first record, and the bw' words of the record are read to store locations S, S - 1, ... S -bw' + 1 It is not advisable to write with the octal fraction bk= 0, because when the resulting string, which therefore ends with a zero marker, is read back, the octal fraction bk will be zero regardless of whether reading ended at the zero marker or somewhere short of the marker within the string itself. |
||||||||||||
1041 |
Skip Skip bw words, terminating on a marker bk. Skip operates in the same way as transfer, except that no words are transferred to or from the program store. When in a writing mode, bw addresses on tape are skipped and a marker bk is written after them. Note, however, that the previous contents of these addresses, whether information or marker, are not preserved on tape, except when complete 512-word tape sections are skipped. When in a reading mode, the skip continues until bw words of information have been passed or until a marker ≥ bk is encountered., whichever is the sooner. bw' = the number of words of information actually skipped. bk' = m if a marker m (≥ bk) terminated the transfer or came immediately after word b. Note that skip is less efficient than search for moving long distances along the tape, and should not be used for skipping more than a few sections. |
||||||||||||
1042 |
Mark Available only when in writing mode. Writes a marker K (0 ≤ K ≤ 7) after the last word on the selected tape. This marker replaces any marker which was previously on the tape at this point. After 'writing a string on tape, it may be discovered that the end of a group has been reached. The mark instruction may then be used to change the marker at the end of the string. It may be used again if it is later found that the end of an even higher order group has been reached. A mark instruction may also be used immediately after a start-writing instruction, to write the specified marker before the first record to be written. |
||||||||||||
1043 |
Stop Variable Length Stop variable length operations on tape Ba. After variable length operations for a given tape have been completed, a stop instruction may be given; it will release the buffer blocks associated with those operations. After writing operations, it will cause the last part-section to be written from the buffer to magnetic tape. The following instructions also have the effect of stopping previous variable length operations: start, search, unload, release tape, end program Whenever variable length writing is terminated on a given tape each buffer block that contains information transferred there by a 1040 instruction is written to tape. A buffer block is not written to tape unless it contains such information. This means that the first few words of the last buffer block written may contain the end of the final record, or even just the final marker, and the rest of the block contain perhaps the remains of some previously transferred records. This fact permits one to overwrite individual records without disturbing the records on either side. This is done by filling the buffer with the record that is to be overwritten along with the records, or part of the records, on either side of it. One aligns on the marker at the beginning of the record and starts reading forward (1030) with a buffer large enough to contain the whole record at one time. One then skips (1041) the record in question, starts reading backward (1031, with the same buffer) and skips back over the record to the beginning marker. One switches to write mode (1032, same buffer again) and writes the new string in its proper place. A stop instruction (1043) will then finish the job by causing the buffer blocks, now containing the new string in place of the old, to be written back to the tape. The two uses of the skip instruction are necessary to make the marker at the beginning of the old string available for the construction of the marker at the beginning of the new string. |
||||||||||||
1044 |
Word Search Search tape Ba for the section and word specified in the full word with address S. Stop variable length operations on tape Ba. The section and word are given as 21 bit integers in the more and less significant halfwords in full words respectively. The section number must be greater than 0, and less than 5000; the word number is taken modulo 512. This instruction must be used to align the tape on a marker before using a start instruction; after the word search, a start instruction is necessary before further variable length operations on tape Ba. |
||||||||||||
1036 |
Set ba' = number of selected tape Place in bits 10-16 of Ba the program number of the tape currently selected for variable length operation. If there is no tape currently selected, ba' will be negative. Bits 10-16 correspond to the Ba position in the more significant halfword of an instruction. One application is to enable a sub-routine to select a different tape for variable length transfers, and then to re-select the original tape before the main program is re-entered. |
||||||||||||
1037 |
Store 'mode of tape Ba' in S The transfer mode at present selected for tape Ba will be indicated by placing in half-word S the appropriate integer from the following table:-
|
Examples:
1. Tape 1 contains a file of variable length records and tape 2 contains amendments to this file. The information on each tape starts at section 1 and the records are not more than 40 words long. Each record is terminated by a marker 1, except the last record which is terminated by a marker 2. Each record is identified by a key in its first half-word, and the records in each file are sorted in ascending order of keys. It is required to form an updated file on tape 3 by inserting the amendment records in place of the corresponding records on the original file.
1)H 1 0 1044 1 0 A1 Initiates 1030 1 0 20:0.1 variable length 1044 2 0 A1 operations 1030 2 0 22:0.1 on tapes 1044 3 0 A1 1, 2, and 3 1032 3 0 24:0.1 4) 1033 2 0 0 Read 121 12 0 50 Amendment 1040 12 0 100 Record 5) 1033 1 0 0 Read 121 11 0 50 Main-File 1040 11 0 150 Record 1033 3 0 0 Select Update file 101 10 0 150 Go to A7 102 10 0 100 if Amendment Key equals 214 127 10 A7 Main-File Key 1040 11 0 150 Write Main-File record 210 127 11 A5 Go to read next record if marker is odd 1117 0 0 0 End program 7) 1040 12 0 100 Write Amendment 210 127 12 A4 Go to read next amendment if amendment marker is odd 1042 0 0 0.1 Write a marker one 210 127 11 A5 Go to read next Main-File record if marker is odd 1042 0 0 0.2 Marker end of update file 1117 0 0 0 End program
2. There is a 50 word record in section 10 of tape 33 which is preceded by a 7 marker in word 177. replace that record with the 50 consecutive words beginning in the store at A3, leaving the 7 marker undisturbed.
3) H 10,177 Section 10, word 177 1044 33 0 A3 Search for marker 1030 33 0 1: Fill the one block buffer 1041 0 0 0 Skip to the end of next record 1031 33 0 1: Read backward 1041 0 0 0 Skip back to head of record 1032 33 0 1: Switch to write mode 121 75 0 50 1040 75 0 A3 Replace record in buffer 1043 33 0 0 Write block 1: to section 10
Although the length of the string was known in advance and B0 mentioned in both of the skip instructions, one could use one of the skip instructions to pick up the length of the string in a B-line.
If the 1032 write instruction is replaced by a 1042 mark instruction the program will replace only the mark at the head of the string.
The basic magnetic tape operations on Atlas transfer information in blocks of 512 words, but the variable length instructions disguise this fixed block structure. Provided that the length of transfers is small compared with the size of the buffer, these instructions also provide overlap of tape transfers and computing. To achieve these effects, extra words are written on the tape as markers and extra instructions are obeyed to transfer the information between the buffer and the program store. Provided that the variable length records are not too short, the loss of efficiency is not high. With a two-block buffer and. records of 50 to 150 words, the use of variable length instructions might be expected to increase the cost of a job by perhaps 1% or 2%. This efficiency will be maintained with longer transfers also, but the automatic overlap of transfers via the computing will be lost as the transfer size approaches the buffer size.
A number of organizational instructions are provided to cope with special situations which will arise in some magnetic tape programs. Many of the operations which these instructions perform are usually required near the beginning or end of the program, and they are then best left to the job description or the 1117 (end program) instruction. One exception to this rule is the instruction 1017 (Free Tape), which should be used before the 1117 instruction if the information on any titled tape is not required again.
Programs frequently require to use magnetic tapes as working space, without wanting to keep them after the job has been run. Such magnetic tapes should be requested under a heading TAPE COMMON in the job description.
For a long job, it may be desired to restart the job after a machine failure severe enough for common tapes to be lost; in such a case tapes should be requested under TAPE NEW. In exceptional circumstances a title may be written to a common tape, which is then kept by the user after the job has ended; the operator will be notified, and the Atlas installation may take action to discourage a user from doing this at all often.
The title stored in section 0 of the tape is referred to by extracodes 1014 and 1015 (Write Title & Search for Block 1, and Read Title or Tape Number). These refer by its main store address to a copy of the tape title, stored as one record; the 6-bit characters are packed 8 to a word and the last character is binary zero.
If a program requires to use magnetic tape, its job description must indicate the number of magnetic tape mechanisms required. Normally this is done by listing the magnetic tapes which are required to be mounted on these mechanisms initially: the Supervisor will then ensure that these tapes are mounted before the program is entered. The details of how the job description is prepared are given in Chapter 10.
If further magnetic tapes are required after a program has been entered, they should be listed in the job description and may then be called in by obeying mount instructions. However, the total number of mechanisms in use at any one time must not exceed the number reserved in the job description. A mount instruction should, if possible, be obeyed at least 2 minutes before the tape to which it refers is required; otherwise the tape may not be ready in time and the program will have to wait. Note that the program will be monitored if it calls for a new tape to be mounted at a time when none of its reserved mechanisms has been made free. If there is a spare tape mechanism, the tape may be mounted on it by the operator before the program calls for it.
The tape reference letter referred to in the mount extracodes is a letter associated with the tape in the job description (see chapter 10).
The mount instructions are as follows:-
Function | Description |
---|---|
1010 |
Mount Allocate the number Ba to the tape whose tape reference letter is in the 6 least significant bits of n, in internal code. If this tape is not already available, instruct the operator to mount it on any available tape mechanism. If the tape is in the TAPE category, check its title; if in the TAPE NEW category, write into the section 0 the title given in the job description: if in the TAPE COMMON category, leave the tape untitled. |
1011 |
Mount Free Allocate the number Ba to a free tape. If no free tape is available instruct the operator to mount one on any available tape mechanism. This extracode should only be used in exceptional circumstances; normally all tapes required should be listed in the job description. The operator will be informed whenever this extracode is used, and an installation may take action if it is used overmuch. |
1007 |
Mount Next Reel of File Allocate the number n to the next reel of file Ba. If this tape is not mounted, instruct the operator to mount it on any available mechanism. |
The following mount instructions refer to logical channel number (K = 0 to 3) of a given program. These logical channel numbers do not each refer to a fixed magnetic tape channel: they are merely a device to enable the program to separate on to different channels the magnetic tapes that it requires to operate simultaneously. On an installation with only one tape mechanism on each of the eight tape channels, there is no advantage in specifying channel numbers. On larger installations, the tape mechanisms are grouped together on pairs of channels, and the logical channel numbers then refer to these pairs.
A program' s referring to logical channel number K has the following effect. If no channel has been previously designated logical channel K of the program, the new tape is mounted, if possible, on a channel different to any which has been previously designated a logical channel of the program; that channel is then designated logical channel K of the given program. If a channel has been previously designated logical channel K of the program, then the new tape is mounted on the same channel, if possible. A channel may also be designated logical channel K of the program by the Job Description; see chapter 10.
Function | Description |
---|---|
1012 |
Mount on Channel K Allocate the number Ba to the tape whose tape reference letter is in the 6 least significant bits of n, in internal code. If this tape is not already available, instruct the operator to mount it if possible, on channel K of this program, where K is the most significant octal digit of n. If the Tape is in the TAPE category, check its title; if in the TAPE NEW category, write into section 0 the title given in the job description; if in the TAPE COMMON category, leave the tape untitled. |
1013 |
Mount Free on Channel K Allocate the number Ba to a free tape. If no free tape is available, instruct the operator to mount one, if possible, on channel K of this program, where. K is the most significant octal digit of n. Note that this extracode, as 1011, should be used only in very exceptional circumstances; normally all tapes required should be listed in the job description. The operator will be informed whenever this extracode is used and an installation may take action if it is used overmuch. |
Function | Description |
---|---|
1014 |
Write Title & Search for Block 1 Write to section 0 of tape Ba the title stored in location S onwards, overwriting any title that may be there. Inform the operator that this has been done. |
1015 |
Read Title or Tape Number If S is even (least significant bit is 0), then store in locations S onwards the title of tape Ba, i.e. that currently in section 0. If S is odd (least significant bit is 1), then store in location S the tape serial number of tape Ba. |
In 1014 and 1015 S is taken as a half word address. The tape serial number stored by 1015 will be in internal code, left justified, 8 characters in length.
Function | Description |
---|---|
1016 |
Unload and Store Rewind tape Ba and disengage the tape mechanism on which it is mounted. Instruct the operator to remove the tape, ensure that the correct title is written on the spool, and store it for later use. If n ≠ 0, the number of tape mechanisms reserved for the program is reduced by one. |
1017 |
Free Tape Overwrite the title on section 0 of tape Ba and return the tape to the Supervisor as a Free tape for general use. If n ≠ 0, the number of tape mechanisms reserved for the program is reduced by one. |
1020 |
Release Tape Delete tape Ba from the allocation of this program and make it available for another program, which must call for it by its correct title. The tape is not freed and is not normally disengaged. If n ≠ 0, the number of tape mechanisms reserved for the program is reduced by one. |
1021 |
Free Mechanism Reduce by n the number of tape meohanisms reserved for use by the program. |
1022 |
Re-number Allocate the number n to the tape which was previously referred to in this program as tape number ba. This enables a tape to be given a different number during a subroutine and then to have its original number restored at the end of the subroutine. Note that in this instruction the tape number is ba and not Ba. |
1023 |
How Long? s' = Number of 512-word sections available on tape Ba (excluding section 0). The number of sections available on a standard-length tape is 4999, but this instruction may be of value if shorter tapes are used. The tape will be rewound. |
1024 |
Where Am I? s' = A; s*' = W (0 ≤ W ≤ 511 ). This instruction places the address of the next section (going forwards) on tape Ba in the first half-word of the specified full-word address. After variable length transfers, the second half-word contains the position in the section of the next word to be used. After block transfers, the second half-word is zero. |
An Atlas installation may have as few as 8 one inch magnetic tape mechanisms, or as many as 32. Each mechanism is connected via one of eight channels which can operate simultaneously, each channel controlling one read, write, or search operation. Wind and rewind operations are autonomous and need the channel only to initiate and, if required, to terminate them.
The layout of the control system depends on the individual installation. When there are only 8 mechanisms, each mechanism has its own control channel. When there are more than 8 mechanisms, the 8 channels are grouped into 4 pairs and some or all of these pairs are adapted to control up to 8 mechanisms; any two of the mechanisms on one such pair of channels can then operate simultaneously at anyone time.
The tape mechanism is the Ampex TM2, using one inch wide magnetic tape. There are 16 tracks across the tape, used as follows:
Information is stored on tape in blocks or sections of 512 48-bit words, followed by a 24-bit checksum. Each section is preceded by a leading block marker and a section address, and terminated by a trailing block marker and a zero address. Tapes are tested and pre-addressed by a special run on the machine before they are put into use, and the fixed position of addresses permits selective overwriting of sections. Checksums are of 24 bits with end-around carry; they are used to check the accuracy of all reading and writing operations.
A 48-bit word is represented by four lateral stripes of 12 information bits, and a checksum by two stripes. Each 512-word section of information contains 2050 stripes and has an average length of 5.46 inches, with a gap of 2.3 inches between sections. Tapes are 3600 feet long and hold 5000 sections, or 2½ million 48-bit words.
The normal tape speed is about 120 inches per second and there are 375 binary digits per inch on each track. This gives an instantaneous transfer rate of 90,000 6-bit characters per second, or one 48-bit Atlas word every 89 microseconds. Allowing for the gaps between sections, the effective transfer rate is about 64,000 characters per second. This is equivalent to one 512-word section every 64 milliseconds, or one word every 125 microseconds, on average. There are also fast wind and rewind operations at about 180 inches per second, and these are used for long searches along the tape.
There are independent write and read heads, separated by a gap of about.39 inches. When not operating, the tape stops with the read head roughly midway between sections, ready to read the next section address. It is possible to read when the tape is moving either in the forward or reverse direction, but writing is only possible when the tape is moving forwards.
A program is held up if it attempts to read from or write to a block of store which is involved in a magnetic tape transfer. The Supervisor may then enter another program until the transfer is completed.
If a magnetic tape block transfer cannot be initiated when it is requested, it is placed in a queue. If the queue is already full the program is held up.
A write-permit ring must be fitted to a reel of tape before that reel can be written on. Tapes containing permanent information will not have such a ring. A write-inhibit switch is also provided on each mechanism, which the operator can use to isolate the tape. It is only possible to write on a tape when the write-permit ring is on and the write current is switched on.
The address of the relevant section on tape is checked before all reading and writing operations, to make sure that the correct section is used. The information in each section is checked by means of a 24-bit checksum at the end of the section: this checksum is used to detect faulty writing or reading, which cause the operation to be repeated under the control of the Supervisor.
When a magnetic tape has useful information on it, a descriptive title of that information is stored in block 0 of the tape. This is in addition to the tape serial number, which is permanently associated with the tape and is unalterable by the user. This tape title can be up to 80 characters long, though the Supervisor prints out only the first 30 characters in operator messages. It is stored on tape in Atlas Internal Code with tab. and multiple spaces (including tab.) replaced by a single space; initial spaces, tabs, full stops, and commas are ignored. Shifts are ignored throughout the title. (see Chapter 10. )
It is possible to read into Atlas tapes prepared on the I.C.T. Orion Computer. This is accomplished by the use of the following two extracodes. P is a block address, and K an octal fraction, of the form P:0.K.
Function | Description |
---|---|
1046 |
Read Orion Tape Ba forwards A check is first made that tape Ba is in fact an Orion tape (if it is, zero will have been read from the first bit of the first block when the tape was mounted). Then, reading forwards, the next section is read into store blocks P onwards. K + 1 blocks will be reserved for the transfer - if this is not sufficient, the program will be monitored. Up to 4096 words may be transferred, but there is no automatic indication of the number of words actually read. |
1048 |
Read Orion Tape Ba backwards This is very similar to 1046, the difference being that the first word transferred is placed in the last word of block P + K and the tape is read backwards. |
Some of the organizational instructions listed in section 9.5 may be used with Orion tapes. These are given below.
1010 | Mount |
1007 | Mount Next reel of File |
1012 | Mount on Channel K |
1015 | Read Title or Tape Nuumber |
1016 | Unload and Store |
1020 | Release Tape |
1021 | Free Mechanism |
1022 | Renumber |
1023 | How Long? |
1024 | Where Am I? (The section number only will be given; the second half word will be zero.) |
The title read by the 1015 instruction will consist of up to ten words separated by /, the words containing up to eight characters. The characters will be letters, digits or full stop.
In the Job description (chapter 10), Orion tapes must be listed under TAPE headings, and the title must be given in the form described for the 1015 extracode.
Information on each magnetic tape is split up into sections or records consisting of up to 4096 six bit characters each. Groups of records may be formed into a file, separated from other files by file marks - short, standard records recognised by hardware. When the tape is first mounted it is positioned ready move forward and use the first record. As the records are of variable length, and the tape is not pre-addressed, it is very difficult to use particular records unless these occur sequentially on the tape. The file marks enable unwanted files to be neglected without having to examine every record within them.
Searching for file marks is a relatively slow process compared with the computing speed of Atlas, and the time taken is proportional to the length of tape traversed. Any search instructions should be given as early as possible in the program.
The characters stored on the tape each have a parity bit associated with them - the programmer can choose whether this should give odd or even parity. The character themselves may be in one of two forms: Binary Coded Decimal, (BCD) usually for input or output data, and normally with even parity, or pure Binary, usually with odd parity, where the tapes are used as an extension of the compute store. The characters may be packed with one of up to three densities on the tape.
The tape which is required for processing is initially selected by obeying a 1260 instruction, which also defines the maximum record length, and the mode of transfer. All succeeding half inch tape instructions apply to this tape, with the exception of the 1262 instruction. The tape number is that appearing in the job description, and is specified by the Ba digits of the instruction (0 ≤ Ba ≤ 126). The maximum record length is specified by bits 12-20 of the singly-modified operand n; hence the longest record allowable is 512 Atlas words, or 4096 characters. The octal fraction of n determines the mode of transfer as follows:-
bit 21 = 0 for odd parity
bit 21 = 1 for even parity
bit 22 = 0 if no code conversion is required (binary)
bit 21 = 1 if code conversion is required (BCD)
bit 23 must be zero
Thus the instruction
1260 42 0 48
would select tape 42 to provide backing store, transfers being unconverted with odd parity, with a maximum of 384 characters in any record.
1260 2 0 4.6
would select tape 2 for B.C.D. even parity working, maximum record length 32 characters.
It may often be necessary to find which tape is being used, for instance on entering a subroutine. Extracode 1261 will find the selected tape, mode, and record length. The contents of Ba will be set to the tape selected, stored in the half word position, bits 15-21. ba will be set to J4 if no half inch tapes ar selected. The record length and mode will be given in the same way as for the 1260 instruction, and will appear in the B-line specified in the half-word position (bits 15-21) of the singly modified operand n. Thus the instruction
1261 10 0 1101
at the beginning of a routine, and
121 121 10 0 1260 122 11 0
at the end would preserve the half inch tape selected on entry, together with the maximum record length and mode of transfer.
Before any transfers take place, the instruction 1256 must be obeyed to select the density of character packing on the currently chosen tape, using operand n as follows:-
n = 0 for low density, 200 characters per inch
n = 0.4 for medium density, 556 characters per inch
n = 1 for high density, 800 characters per inch
This density applies to the selected channel and should not be changed between tape transfers. If an attempt is made to read a tape in a higher density than it has been written in, the situation may be irretrievable. Hence if a tape's density is unknown, it should be read first with low density selected. If the wrong density is selected, there will be a read failure, which may be trapped (see sections 9.11 and 11.2).
Records are written to the selected tape using the 1270 extracode. The number of characters, specified by bits 12-23 of ba, must not exceed the number specified by the 1260 extracode. The first character transferred is taken from the address S.
The 1274 instruction will read the next record from the tape. Ba must be 1; S specifies the character position to which the first character will be transferred. Thus
1260 1 0 63.4
will transfer the next record from tape to store, starting at address location 63.4. If S < 0 there will be no storage of the record, providing a means of skipping records. If the number of words in the record is greater than the maximum specified by the 1260 instruction, the tape will continue to move to the end of the record, but the excess words will be lost.
The 1276 instruction sets ba to the number of characters transferred from the tape by the previous 1274 instruction reading from the currently selected half inch tape. This may be greater than the maximum length specified by the 1260 instruction, in which case characters will have been lost.
Besides reading and writing records, it is also possible to move the tape along without either operation occurring. Skipping one record forward is achieved by reading to a negative store address using 1274. The instruction
1275 1 0 S
where S is negative, will skip one record backwards.
The tape is moved more quickly when searching for a file mark than when simply scanning each record, and so the 1257 instruction allows this faster search either backward or forward along the tape; 1257 is also used to write a file mark at the current position of the selected tape. The operation performed depends on the value of Ba as follows:-
The tape may be rewound and positioned ready to read the first record by obeying the instruction
1267 0 0 0
When a program deals with data that may be either on one inch tape or on half inch tape it is necessary to know which is being used in a particular run. Obeying a 1262 instruction will set ba according to the type of device that is listed as number n (singly modified operand) in the job description. Thus
1262 10 0 6
will set
b10' = 0 if device 6 in the job description is a one inch tape mechanism
b10' = 0.4 if device 6 is a half inch tape mechanism
b10' = J4 if no device 6 is defined.
The following instructions have a similar use for both one and half inch mechanisms.
Mount tape
For half inch tape, although it will be called for by name no check can be made that the correct tape is mounted.
Unload and Store
Release Mechanisms
Select density n on selected mechanism
n = 0 low density, 200ch/in
n = 0.4 medium density, 556ch/in
n = 1 high density, 800ch/in
Reading in a higher density than the tape is written in has an unpredictable effect. Once the correct density is found, no further changes should be made.
Write file mark/Skip to file mark, using selected device.
Ba = 0, write a file mark
Ba = 1, position the tape to read the record following the next file mark, moving the tape forwards.
Ba = 2, move the tape backwards to the previous file mark, positioning the tape to read the file mark.
Select deck Ba; define record length and mode of transfer n. (0 ≤ Ba ≤ 126)
Bits 12-20 of n define the maximum record length
Bit 21 of n = 0 for odd parity
Bit 21 of n = 1 otherwise
Bit 22 of n = 0 if no code conversion required
Bit 22 of n = 1 otherwise
Bit 23 of n = 0 always
Set ba to selected device; set b(n) to record length and mode defined.
ba' = number of selected deck in the half word position
ba' = J4 if no half inch tape mechanism selected.
The B-register given in bits 15-21 of n is set to the record length and mode as defined in 1260.
Set ba to type of device n (bits 0-20)
ba' = 0 if device n is one inch tape
ba' = 0.4 if device n is half inch tape
ba' = J4 if no device n defined
Rewind selected device
Position tape to read first record.
Write a record of ba characters from core store starting at S to select device
ba must not exceed the number of characters defined by 1260
Read a record to core store starting at S/Skip forward one record, usin selected device.
Ba must be 1.
If the record is longer than defined by 1260, the extra characters will be lost. If S < 0, there will be no transfer, only skipping.
Skip backward one record on selected device.
Ba must be 1, and S negative
Set ba to length of previous record read from selected device.
If ba' is greater than the record length defined in 1260, characters have been lost.
An Atlas installation may have up to 6 half inch magnetic tape mechanisms all connected to the computer through one channel, which may be used by one inch mechanisms in the usual way. This channel controls a read, write or backspace operation on one deck at any one time. Rewind operations are autonomous, and need the channel only to initiate them. A search for a file mark is autonomous with any operations involving one inch mechanisms connected to the same channel.
The tape mechanism is the IBM 729 Mark IV or the Potter MTS 120X - 41306; using half inch wide magnetic tape. There are seven tracks across the tape; six are used for data, and one for parity. There is no clock track provided; characters are recognised by the presence of a bit in at least one of the tracks.
Information is stored on tape in blocks or records, which can be of any length, and are unaddressed. Because records are of variable length, selective overwriting is virtually impossible. At the end of each record is one character generated from the parities of each track in the record; these parity characters are used to check the accuracy of all reading and writing operations. Records may be grouped into files separated by file marks - short records recognised by the hardware.
Data is stored in two different character representations.
Three densities of recording are possible: 200, 556 and 800 characters per inch. Each record is separated from its neighbour by a 3/4" gap in which nothing is recorded. Tapes are up to 2400 feet long.
For the IBM deck, the normal tape speed is 112.5 inches per second, allowing instantaneous transfer rates of 22,500, 62,500 or 90,000 characters per second for the low, medium and high densities respectively. There is a fast wind and rewind speed of about 500 inches per second; this speed is also used on long searches for file marks. For the Potter decks the normal tape speed is 120 inches per second giving instantaneous transfer rates of 24,000, 66,600 and 96,000 characters per second. The fast wind speed is 240 inches per second.
There are independent read and write heads, separated by a gap of about 0.3 inches. It is possible to read or write when the tape is moving forwards only, although the tape may be backspaced a record at a time.
A program is held up if it attempts to read from or write to a block of store which is involved in a magnetic tape transfer. The Supervisor may then enter another program until the transfer is completed.
If a transfer cannot be initiated when it is requested, it is placed in queue; if this is already full, the program is held up.
A write permit ring must be fitted to a reel of tape before that reel can be written on. Tapes containing permanent information will not have such a ring.
Because the tape's title is not written on the tape itself, the operator must ensure that the correct tape is mounted on the deck allocated; the Supervisor will assume that any tape so mounted will be the one requested.
Trap entry 7 is now defined as
IBM TAPE ERROR
This message will be printed by the Supervisor if the fault is not trapped (see Chapter 11). If the fault is trapped, B119 contains a number giving the reason for monitoring; this number is printed in decimal after IBM TAPE ERROR if not trapped.
b119 | Reason for monitoring |
---|---|
0.0 | Filemark read by 1274 |
0.4 | Read failure |
1.0 | End of tape detected either following a skip backwards or a write instruction |
1.4 | Write failure |
2.0 | Failure to detect a filemark |
2.4 | No IBM LAM within 2 minutes |