LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN 510.84 coi Digitized by the Internet Archive in 2013 http://archive.org/details/programorganizat33whee UNIVERSITY OF ILLINOIS DIGITAL COMPUTER INTERNAL REPORT NO. 33 PROGRAM ORGANIZATION FOR THE UNIVERSITY OF ILLINOIS DIGITAL COMPUTER BY D. J. Wheeler May 16, 1952 August 10, 1954 INTRODUCTION It is necessary to have some means of arranging that orders punched on an input tape are formed from their component sexadecimal characters on the tape and placed in their correct positions in the memory. There are two ways that this can "be done -with the University of Illinois machine. (1) The mode of operation can he changed to order pairs and a tape and a memory order inserted in the order register. Then groups of 10 sexadecimal characters are read from the tape and the corresponding words appear in sequence in the memory. This method requires considerable manual control and will not he discussed further. (2) The desired program is preceded by an input routine. This routine can take a variety of forms, and the programs must be prepared accordingly. It is not necessary to standarize the input routine although it is advantageous if all programs for the machine are prepared in the same way. This .standarization does not prevent a programmer from using his own input routine, but it will prevent his using directly other programs or subroutines written in the standard code . The Decimal Order Input is a compromise between facilities and complexity. It arranges for the preparation of programs in a natural manner, including provision for incorporating subroutines within a program. FORM OF ORDERS It is convenient to write orders in the form in which they will have to be punched on the input tape, this will save one translation which would otherwise be necessary. -2- Each order is punched as: (a) Two characters which describe the type and variant of the order. These are called instruction digits or function digits and are defined in the order code. For example, L5 stands for the order clear accumulator and add. (b ) Decimal digits forming the address of the order, with non-significant zeros omitted, e.g., 1023, 7, 35. The memory locations are numbered from to 1023 • (c) A terminating symbol such as K,S,N,J,F,L. Thus we could have orders L5 66f, ^0 1%, 75 F, etc. The terminating symbols have the following meanings : F This means fixed address. The order is unmodified. L This means relative address . The order kO JL will have an address 7 greater than the address (location) of the first word of its group. S This gives a way of modifying orders . It is not truly a terminating symbol because always one and only one character needs to be punched after it. The terminal Sd where d = 3,^,5,6,7,8,9,'$ S,N,J,F,L causes the content of memory location d = 3, • • .,10,11,12,13,1^,15* to ^ e added to the order before it is placed in the memory. Thus if memory location 7 contains OOF 006F = 6 x 2 , then 6 will be added to all the orders terminated by S7, whether these orders are in the left or right hand half of a word. J This causes the address to be multiplied by 2 /l0 before being added to the function digits. It thus gives a way of converting decimal fractions to binary form. The decimal fraction is punched in the address digits of the right hand order and all other digits of the left and right hand orders are made equal to zero. For example, 0.3333 3333 3333 can be read as the order pair: OOF 00 3333 3333 3333 J* The second address should contain 39 11 12 decimals, representing an integer less than 2 , about 5«5 x 10 This enables decimal fractions in the range to +.5 to be converted. We can extend the range by making the function digits of the first order kO, 80, or NO, representing l/2, -1, -1/2, since the converted decimal fraction is added to them. Thus -.8888 8888 8888 = -1 + .1111 nil 1112 = 80F 00 nil 1111 1112 J and .6789 123^ 5678 « l/2 + .12 89 123^5 5^78 = kOF 00 1289 12 3^5 5678 J. This is not an efficient means of reading -3- decimal data "but it may be ueed with advantage to take in decimal numbers scattered in the program. K This is a directive symbol. The order terminated "by K, as (AB nK), is not paired with any other order or placed in the program. Instead it causes the following words on the tape to he placed in the sequence of locations n, n+1, n+2, etc. and their relative addresses (see L) to be increased by n. Thus to place a subroutine in locations m, m+1, etc., we precede it by 00 mK, where the Immaterial values of A and B have been arbitrarily set to 0. N This is used with a control transfer order to start the program. It is never stored in the memory and it must follow an integral number of words, i.e., it must appear on the tape as if it were to be a left hand order. For example, the order 26 hN will be obeyed and will transfer control to the left hand order at memory location n. It is advisable to make this a stop version of the control orders. This can simplify making corrections SUMMARY OF THE ACTION OF THE, INPUT ROUTINE The machine is made ready to receive a program by pressing the set-up button on the control panel. When the control switch is moved to the run position a bootstrap routine on the tape puts itself into locations 0, 1 and 2 and then reads the decimal order input into locations 999 - 1023- Con- trol is then passed to the decimal order input routine by a transfer control order . The decimal order input will then read in orders, assemble them, pair them and place the resulting order pairs in sequence in the memory. Locations and 1 are used as temporary storage, being used to store the current address while the left hand 20 digits of 1 contain the previous order, and the next 8 digits contain the function digits of the current order. As each order is constructed, an order pair will be placed in the memory, but the address of the ^-0 (store ) order which places these order pairs in the memory is only increased by 1 for every second order assembled, so that the final order pair in any location will be correct. -K- The above action is interrupted by directives which alter the address in the distributing order and cause the next order on the tape to be placed in the left hand side of the location specified in the directive. Control is transferred by writing N after a control transfer order. The N causes this order to be obeyed. Occasionally it may be desired to transfer control to a relative address, say to the right hand order in JL. This may be done by following the subroutine with an order pair such as: AB nF 22 7L, 26 IN in which the digits indicated by AB nF are arbitrary. This causes control to be transferred to the last order taken in - a copy of which always appears as the left hand order of 1. This last order can then transfer control as required to a relative or fixed address . When it is desired to resume assembling orders from the tape (after an interlude, etc.), then control can be transferred to the left side of 999 (3F7 sexadecimal). Either the first order on the tape must be a directive -39 or the Q register must contain m x 2 where it is desired to place the input words in m, m+1, m+2, etc.. It may occasionally be desired to read more words into some positions retaining the previous relative base address. This may be done by transferring control to the right hand side of the order pair 101^, with the -39 address m x 2 in the A register. The following words will be placed in m, m+1 m+2, retaining the previous relative address. CONVENTIONS IN WRITING ORDERS (1) Orders should be written in a simple list with a space between the function characters and address . (2) On the left hand side of the list, there should be written the locations into which the orders go. (3) Groups of orders should be annotated on the right. (k) Brackets should be used to indicate orders which be- come changed during the course of the program. (5) A double vertical line can be used to distinguish constants . -5- (6) A red underline is sometimes useful for marking un- conditional transfer orders . (7) Non-sexadecimal characters may be used to clarify the code and will not be punched. For example, in 50 (&. )F the a is not punched, A specimen is given on the next page. (8) Immediately to the right of any order, a note from a should indicate if control is transferred from a to that point. Similarly if any order is altered — as indicated by brackets — then a note by B should be used to indicate the location of the order doing the adjusting. It should be noted that whenever the 5"th hol% of the input tape is punched, then the input mechanism completely ignores this character. This allows errors on the tape to be erased and allows layout characters on the input tape to be ignored. LOCATION ORDER NOTES 18 L5 26L kO 20L Set i = 19 27 20L S5 F From 23 20 50 (a^F By 18 n(:q ) + N(80 + i) 2 x 2"' 7^ (a i )F and 22 21 L5 20L Lk 2kL Increase i by 1. 22 kO 20L LO 25L Test for end 23 32 19L 26 27L 2k 00 IF 00 IF Units 25 50 100F 7^ 100F End test constant 26 50 80F 7k ROTT Starting constant Figure 1. SAMPLE CODE -6- SUBEOUTINE CONVENTIONS All subroutines will consist of an integral number of words, will "be constructed to be read by the decimal order input, will be available as strips of punched paper tape, and will be described on a specification sheet which will give all the details necessary for use. CLOSED SUBROUTINES This type of subroutine will have to be entered with the address n in the right hand 10 digits of the Q register. When the subroutine has per- formed its part of the calculation it will transfer control to the right hand order in location n+1. Usually the calling in orders will be as in Figure 2 . LOCATION ORDER NOTES — -: n ANY 50 nF This order puts itself in Q, . n+1 26 pF p is the start of the subroutine. Control returns to right side of n+1 ANY when subroutine is finished. FIGURE 2. CALLING IN ORDERS The subroutine will usually be of the form shown in Figure 3* LOCATION ORDER NOTES 1+0 F Subroutine location OL is pF. K5 F Stores argument. 1 k2 qL Calculate link address for return to main • program . • <1 ANY By 1 22 (n+l)F The last order of the subroutine to be obeyed 1 is in the right hand side of q. FIGURE 3. ORGANIZATION OF A TYPICAL CLOSED ROUTINE ,^V> UN °4