Universal Interpretive System (UIS)

N. S. GOLOSOV, O. K. GORDEEV
Submitted 1969 | SovietRxiv: ru-196901.10016 | Translated from Russian

Abstract Generated abstract

This paper describes a universal interpretive system for the Minsk-1 computer, intended to reduce program memory requirements and support floating-point programming despite the machine’s limited operating memory. The authors define a set of arithmetic and logical pseudocommands, including operations using a pseudo-accumulator, conditional and unconditional transfers, number conversion routines, cycle organization, and automatic readdressing within loops. They argue that the system addresses limitations of earlier interpreters by allowing interpretation to be switched off when unnecessary, integrating standard subroutines through a characteristics table, and simplifying the construction of complex cyclic programs. The paper includes program listings, constants, and examples of loop organization and conversion subroutines to document the implementation.

Full Text

UNIVERSAL INTERPRETING SYSTEM

(UIS)

N. S. GOLOSOV, O. K. GORDEEV

(Presented by the scientific seminar of the computing laboratory of TPI)

Despite its comparatively small operating memory (1777 cells), the “Minsk-1” computer, thanks to its reliable operation, can solve rather complex engineering problems. As the problems being solved become more complicated, the programmer is forced to abandon programming by the fixed-point method and to switch to programming by the floating-point method. However, this leads to a great increase in the amount of operating memory occupied by the program in relation to the number of operations performed, since the number of service actions increases: transfers, references, etc. This circumstance leads to the need to expand the machine codes into pseudocodes, i.e., actions that the machine cannot correctly perform without a special program interpreting the pseudocodes in machine codes. This makes it possible, with some increase in machine time, to reduce significantly the size of the program in memory and to expand the class of problems solved on the “Minsk-1” computer.

Several interpreting systems have been published in print [1, 2, 3]; however, despite their undoubted interest, in our opinion they have a number of substantial shortcomings. First, the set of PK is clearly limited and does not fully solve the question of automating programming by the floating-point method. Second, for example, the IS proposed in [1], once included in interpretation, cannot be programmatically switched off at the point where interpretation is completely meaningless (for example, in certain SP), which leads to an unjustified loss of machine time. And finally, third, the organization of the interpretation of PK takes more commands than is necessary. In addition, the presence in the subroutine for addition of two multiplication operations leads to an increase in its operating time by approximately one third, and in division by a factor of two. In creating the new interpreting system these shortcomings were taken into account and, as far as possible, eliminated.

Arithmetic pseudocommands; organization of the operation of standard subroutines

The universal interpreting system interprets only the set of pseudocodes; therefore all machine codes found among the PK are executed just as they are executed in the machine, and, in addition, the result of the operation is placed in cell 0023. The sign of PK is ...

index 2000, standing in any address, if there are no additional qualifications for this pseudocode.

The numbers with which the UIS works are represented in two consecutive cells \(A\) and \(A+1\), the order and the mantissa. The UIS interprets the following arithmetic operations:

\[ \begin{aligned} \pm 10\quad &2000 + A_1\quad A_2\quad A_2 + A_1,\\ \pm 11\quad &2000 + A_1\quad A_2\quad A_2 - A_1,\\ \pm 12\quad &2000 + A_1\quad A_2\quad A_2 : A_1,\\ \pm 13\quad &2000 + A_1\quad A_2\quad A_2 \times A_1. \end{aligned} \]

Under these pseudo-commands the following occurs. The contents of \(A_1\), \(A_1+1\) are sent to 0020, 0021; \(A_2\), \(A_2+1\) are sent to 0022, 0023; the prescribed operation is performed; the result of the operation is obtained in the working cells 0022, 0023; in addition, the result is sent to cells \(A_2\) and \(A_2+1\). Since the result of the operation is always obtained in cells 0022, 0023, we shall call them the pseudo-accumulator (PA). Arithmetic operations can be performed in the form of modifications of operations with the PA. With index 4000 in \(A_1\), the operation will be performed not with the contents of \(A_2\), but with the contents of the PA, and the result is sent to cell \(A_2\). With index 4000 in \(A_2\), the result of the operation remains in the PA. Indices are also possible simultaneously in both addresses.

Standard subprograms (SS), without interpretation, work with automatic switching-off and switching-on of the UIS. This is achieved by compiling a table of characteristics (TC) and, after the completion of the work of the SS, exiting to a definite cell (0102) of the UIS. The TC is compiled as follows: to cells, beginning with 0325, are assigned the numbers of PCs 16, 17, etc., up to 77. If in a cell, for example, 327, one places an unconditional transfer-of-control command to the beginning of the SS, then by this we introduce the “arithmetic” PC \(20\ 2000 + A_1A_2\). Under this PC, encountered in the main program, all actions with addresses prescribed for the addresses of arithmetic PCs are performed, while the arithmetic operation is replaced by the action of the indicated SS. The compilation of TC rows can easily be carried out by a slightly modified RП-1 [1].

Pseudocodes 14, 15 denote the conversion of numbers respectively from the decimal number system to the binary and from the binary to the decimal, with printing by SS [3]. In the UIS, space is allocated where, at the beginning of work, SS \(10 = 2\) is placed. During the operation of the program, in the event that the required (14 or 15) SS is not present in storage, it is read from the MSU from the indicated zone (see Appendix 1). Reference to an SS or to the operators compiled in the accepted PCs can also be carried out with the aid of the logical PC \(\pm 03\ 2000 + A_1A_2\) (see below).

Logical pseudo-commands and the organization of cyclic programs with readdressing

Logical pseudo-commands perform a number of standard actions that frequently occur in programs and are introduced for the convenience of programming, for reducing the amount of memory occupied by the main program, and for speeding up its operation. Seven logical pseudo-commands and a PC for transferring a number are interpreted.

\[ \pm 01\quad 2000 + A_1A_2 \]

— switching off the UIS with preparation for switching on. Under this PC the UIS terminates its work, is set up for switching on from cell \(A_2\), and transfers control to cell \(A_1\). If, after the work of the codes, transfer of control to cell 0112 follows (the beginning of the UIS operation), the UIS will begin to execute the command from cell \(A_2\).

$\pm 02\ 2000 \pm A_1A_2$. Conditional transfer according to the contents of the pseudo-summator. If the sign of the number $PS$ is positive, transfer to execution of the command in cell $A_1$; if negative—to $A_2$; if the number is equal to zero—execute the next command after this one.

$\pm 04\ 2000 \pm A_1A_2$: an analogous conditional transfer, but only according to the sign of $PS$. The execution by the UIS of these two PCs differs from the execution of codes $54\ A_1A_2$, $34\ A_1A_2$ by sign in that execution of the PC does not lead to disconnection of the UIS, although both types of transfers are by $PS$.

$\pm 03\ 2000 \pm A_1A_2$—unconditional transfer to execution of the command in $A_1$ with sending of the return PC to cell $A_2$. Before beginning execution of the command in cell $A_1$, the UIS sends to cell $A_2$ the pseudocode $\pm 03\ A_1 + 1,\ 2000$, where $A$ is the address of the command being executed. This command is used when referring to operators composed in the PC from different places in the program.

The following three logical pseudocommands serve for organizing cyclic programs. In the UIS two working cells are allotted, one of which stores the cycle step (we shall call it $Sh$), the other the cycle counter (we shall call it $C$).

$\pm 00\ 2000 \pm A_1A_2$—PC for entering the cycle step, equal to $A_1$, and the cycle counter, equal to $A_2$.

$\pm 05\ 2000 \pm A_1A_2$—PC for folding the preceding step and cycle counter into the PC $\pm 00\ 2000 \pm Sh,\ C$, sending it to cell $A_2$, entering the new step, equal to $A_1$, and the counter, equal to zero.

$\pm 06\ 2000 \pm A_1A_2$—PC of conditional transfer by the cycle counter; it performs addition of the step to the counter and transfer to execution of the command in cell $A_1$ if $C \leq A_2$, or to the command following the given one if $C > A_2$.

With the aid of these pseudocodes it is easy to organize any complex cyclic programs. Obviously, in order for a section of a program to be worked through $n$ times, it is necessary in PC 06 to make $A_2 = (n - 1)Sh$ (the scheme for organizing a simple cycle and a cycle within a cycle is given in Appendix 2).

From the scheme for organizing cyclic programs it is clear that each section of a cyclic program is executed with a definite value of $Sh$ and $C$. This circumstance makes it possible to introduce automatic readdressing of PCs, i.e., formation of execution addresses as a function of the contents of $C$. The minus sign in a PC is interpreted as a PC with readdressing; the index 2000 in such a PC indicates the address subject to readdressing. Readdressing is performed according to the rule: before execution, the contents of $C$ are added, in the working cell of the UIS, to the address with the index. Thus, in the first cycle, when $C = 0$, all PCs with readdressing are executed with the addresses that are written in the program. In the second cycle the contents $C = Sh$, therefore all readdressed addresses are shifted by the cycle step, etc.

By this device one can readdress both addresses of all PCs, with the exception of the second addresses of PCs organizing a cycle, where the index 2000 is never placed.

$\pm 07\ 2000 \pm A_1A_2$—PC for sending the contents of $A_1$ to cell $A_2$.

Connection to the UIS is effected with the aid of two commands:

\[ A \qquad 10 \qquad A \qquad 0010, \]

\[ A + 1 \qquad 24 \qquad 0112 \qquad 0112. \]

The UIS described, in our opinion, makes it possible significantly to simplify and accelerate the process of programming the majority of problems.

Appendix 1

In the absence of the required \(SP\) (14 or 15), the UIS reads into the MOSU the corresponding header in cells 20–37, which, in turn, calls the \(SP\), sums it, and, if the sums coincide, continues operation.

Appendix 2

. . . .
\(A+0\) \(+05\) 2002 0000
\(A+1\) \(-15\) 7500 4000
\(A+2\) \(+06\) \(2+A+1\) 0010
. . . .

A simple loop with readdressing operates five times with the translation operator from 2-10. After exiting the loop \(C=0012\), \(Sh=0002\).

. . . .
05 2004 \(A_3\)
\(A_0\) . . .
. . . .
05 2002 \(A_2\)
\(A_1\) . . .
06 \(2+A_1\) 0014
\(A_2\) 00 0000 0000
. . .
. . . .
06 \(2+A_0\) 0010
\(A_3\) 00 0000 0000

The scheme for organizing loops within a loop differs in that each inner loop stores \(C\) and \(Sh\) of the outer loop in the cell following its conditional branch command by \(C\). Exiting the inner loop, the UIS restores the contents of \(C\) and \(Sh\) of the outer loop by executing the command prepared by \(PK\) “05”.

Header 2-10

Address \(\pm KOP\) \(A_1\) \(A_2\)
0020 44 0031 0001
1 44 0230 0271
2 05 0000 0206
3 05 0037 0024
4 \(-00\) 0230 0206
5 01 0011 0024
6 \(-31\) 0036 0000
7 54 0024 0024
0030 \(-11\) 0035 0206
1 54 0020 0020
2 05 0324 0323
3 05 0316 0324
4 24 0134 0000
5 24 7220 4000
6 \(-00\) 0272 0206
7 \(-00\) 0230 0206
73 7546 \(4435x2\)

Subroutine 2-10

Address \(\pm KOP\) \(A_1\) \(A_2\)
0230 05 0000 0022
1 05 0020 0024
2 54 0243 0233
3 31 0262 0000
4 54 0251 0237
5 51 0266 0021
6 54 0251 0237
7 03 0264 0021
0240 01 0263 0024
1 00 0263 0022
2 34 0246 0246
3 03 0266 0021
4 00 0262 0024
5 01 0263 0022
6 15 0021 0020
7 00 0024 0020
0250 34 0231 0231
1 \(-07\) 0020 0021
2 15 0265 0023
3 03 0264 0021
4 26 0024 0020
5 \(-26\) 0023 0023
6 01 0020 0021
7 \(-07\) 0263 0024

Continued

Address ± KOP $A_1$ $A_2$
0260 51 0263 0021
1 34 0253 0267
2 −00 0000 0003
3 −00 0000 0004
4 50 0000 0000
5 −74 0000 0000
6 63 1463 1463
7 −46 0000 0022
0270 −46 0000 0023
1 34 0102 0102

Header 10-2

Address ± KOP $A_1$ $A_2$
0020 44 0021 0001
1 44 0230 0271
2 05 0000 0206
3 05 0037 0024
4 −00 0230 0206
5 01 0011 0024
6 −31 0036 0000
7 54 0024 0024
0030 −11 0035 0206
1 54 0020 0020
2 05 0323 0324
3 05 0316 0323
4 24 0134 0000
5 06 6114 3443
6 −00 0272 0206
7 −00 0230 0206
55 6431 4100к>

Subroutine 10-2

Address ± KOP $A_1$ $A_2$
0230 15 0257 0022
1 05 0260 0264
2 16 0021 0264
3 32 0023 0000
4 20 0022 0022
5 03 0257 0023
6 −07 0261 0264
7 54 0001 0232
0240 15 0022 0022
1 05 0020 0000
2 54 0244 0250
3 34 0102 0102

Continued

Address ± KOP $A_1$ $A_2$
4 03 0257 0023
5 00 0261 0020
6 11 0261 0022
7 24 0254 0264
0250 03 0263 0023
1 01 0261 0020
2 10 0262 0022
3 −26 0000 0264
4 15 0023 0022
5 00 0264 0022
6 34 0241 0241
7 50 0000 0000
0260 −74 0000 0000
1 −00 0000 0004
2 −00 0000 0003
3 63 1463 1463
4 00 0000 0000
5 00 0000 0000
6 00 0000 0000
7 00 0000 0000
0270 00 0000 0000
1 34 0102 0102

UIS Program and Constants

Address ± KOP $A_1$ $A_2$
0001 77 7777 7777
2 40 0000 0000
3 −00 0000 0000
4 20 0000 0000
5 00 7777 0000
6 00 0000 7777
7 77 0000 0000
0010 −02 7775 7672
1 00 0001 0000
2 00 0000 0001
3 00 0001 0001
4 00 0002 0000
5 00 0000 0002
6 00 0002 0002
7 14 0001 7761
0040 −01 0003 0021
1 16 0021 0023
2 54 0046 0046
3 51 0023 0000
4 54 0045 0067 6 00 0000 0000
5 24 0050 0022 7 24 0111 0023
6 01 0022 0020 0120 71 0226 0000
7 34 0050 0054 1 54 0124 0125
0050 00 0020 0022 2 11 0302 0116
1 05 0021 0107 3 24 0127 0116
2 05 0023 0021 4 01 0302 0116
3 05 0107 0023 5 −17 0145 0302
4 51 0070 0020 6 21 0116 0116
5 34 0067 0056 7 16 0007 0116
6 −16 0003 0020 0130 21 0272 0110
7 21 0012 0020 1 54 0134 0150
0060 −07 0020 0021 2 −51 0273 0116
1 −17 0146 0023 3 24 0106 0107
2 30 0021 0000 4 16 0005 0116
3 25 0000 0020 5 −26 0274 0137
4 24 0065 0023 6 20 0013 0140
5 10 0012 0022 7 00 0000 0000
6 20 0020 0022 0140 00 0000 0000
7 34 0102 0102 1 16 0223 0116
0070 00 0000 0036 2 54 0150 0000
1 11 0020 0022 3 −01 0223 0116
2 20 0012 0020 4 36 0006 0003
3 −17 0146 0023 5 −37 0167 0014
4 32 0021 0000 6 −36 0301 0001
5 34 0100 0100 7 24 0136 0137
6 00 0022 0020 0150 −17 0145 0110
7 13 0021 0023 1 20 0277 0152
0100 25 0000 0022 2 00 0000 0000
1 00 0020 0022 3 16 0006 0116
2 16 0222 0116 4 −37 0167 0000
3 54 0111 0000 5 −26 0300 0112
4 16 0006 0116 6 −51 0227 0116
5 −26 0224 0107 7 24 0116 0116
6 20 0013 0110 0160 −17 0144 0110
7 00 0000 0000 1 −26 0221 0110
0110 00 0000 0000 2 −16 0023 0000
1 00 0011 0112 3 24 0110 0000
2 05 0000 0116 4 16 0006 0116
3 36 0225 0000 5 −26 0304 0170
4 54 0127 0120 6 16 0005 0112
5 −16 0023 0000 7 30 0305 0014
0170 00 0000 0000 2 54 0244 0250
1 −07 0167 0116 3 34 0102 0102
2 16 0005 0116 4 03 0257 0023
3 −36 0300 0000 5 00 0261 0020
6 11 0261 0022
4 24 0112 0112
5 10 0303 0302
6 −21 0226 0302
7 16 0006 0116
0200 −37 0167 0000
1 31 0302 0000
2 34 0172 0111
3 16 0006 0116
4 −26 0276 0206
5 −17 0145 0302
6 00 0000 0000
7 16 0000 0302
0210 24 0213 0302
1 16 0006 0116
2 −27 0167 0302
3 16 0005 0116
4 24 0111 0303
5 −01 0275 0216
6 44 0020 0001
7 44 0020 0037
0220 24 0020 0000
1 04 0172 0171
2 00 0000 4000
3 00 4000 0000
4 05 0022 0000
5 −00 2000 2000
6 00 2000 0000
7 35 0000 0000
0230 15 0257 0022
1 05 0260 0264
2 16 0021 0264
3 32 0023 0000
4 20 0022 0022
5 03 0257 0023
6 −07 0261 0264
7 54 0001 0232
0240 15 0022 0022
1 05 0020 0000
7 24 0254 0264
0250 03 0263 0023
1 01 0261 0020
2 10 0262 0022
3 −26 0000 0264
4 15 0023 0022
5 00 0264 0022
6 34 0241 0241
7 50 0000 0000
0260 −74 0000 0000
1 −00 0000 0004
2 −00 0000 0003
3 63 1463 1463
4 00 0000 0000
5 00 0000 0000
6 00 0000 0000
7 00 0000 0000
0270 00 0000 0000
1 34 0102 0102
2 07 0000 0000
3 02 0000 0000
4 05 0000 0 20
5 00 0010 0000
6 −26 0303 0000
7 24 0316 0000
0300 05 0000 0116
1 05 0000 0022
2 00 0000 0000
3 00 0000 0000
4 24 0172 0000
5 03 0001 2000
6 54 0134 0150
7 24 0211 0000
0310 24 0153 0000
1 24 0160 0000
2 24 0164 0000
3 24 0160 0000
4 24 0203 0000
5 24 0175 0000
6 24 0230 0000
7 24 0041 0000
0320 24 0040 0000
1 24 0071 0000
2 24 0076 0000
3 24 0230 0000
4 24 0215 0000

References

  1. N. I. Lozinskii, A. G. Makushkin, V. Ya. Rozenberg, V. R. Erglis. Programmer’s Handbook. Vol. 2, Leningrad, 1964.
  2. I. Ilzinya. Programming for Two-Address Digital Computers, Riga, 1962.
  3. Library of Standard Programs for the “Minsk-1” Computer. ENIMS, Moscow, 1963.

Submission history

Universal Interpretive System (UIS)