On an Interpretive System for the Minsk-1 Electronic Digital Computer
Abstract Generated abstract
This article describes an interpreting system for the Minsk-1 electronic digital computer developed at the Computing Laboratory of TPI as a practical alternative to more complex compiler-based approaches for small and medium machines. It outlines the system’s handling of arithmetic and logical pseudocommands, its use of standard subroutine calls, attachments for array functions and loops, and debugging mechanisms for tracing commands, transfers of control, and intermediate results. The authors report that, compared with the standard interpreting system, the design nearly halves the execution time of arithmetic pseudocommands and shortens programs, while noting remaining drawbacks such as duplicated switch blocks and inconvenient discontinuities in the transfer scale.
Full Text
ON AN INTERPRETING SYSTEM FOR THE “MINSK-1” ELECTRONIC DIGITAL COMPUTER
Yu. N. Efimov, Yu. V. Volkov, V. A. Malyshev
(Presented by the scientific seminar of the Computing Laboratory of TPI)
The problem of automating programming is one of the pressing tasks of contemporary computational mathematics. The growing need to carry out labor-intensive computations accelerated the transition from the method of a library of standard subroutines (SS) to various compiling and interpreting programs, and led to the creation of programming programs and various input languages.
A characteristic feature is the steady attention of scientific thought to the creation of a single input language. In many centers a translator based on “Algol-60” has been implemented. However, the difficulties of its implementation induce users to create simplified variants [1], which indicates the necessity of a differentiated approach to solving this problem, taking into account the features of a particular electronic digital computer and of the given type of problem. Practice shows that, when solving problems on medium and small machines, and also when solving a large number of relatively simple problems, simplified input languages and comparatively simple interpreting systems prove optimal [2].
The present article publishes one of the variants of an interpreting system (IS), which was developed in the Computing Laboratory of TPI and over the course of a year showed good effectiveness.
Interpretation of Pseudocommands
Let us introduce some notation:
\((A)\) — the contents of cells \(A+0\) and \(A+1\),
\(4A\) — an indicator that the address \(A \ge 4000\),
\(2A\) — an indicator that the address \(A \ge 2000\),
\(K4\) — an indicator that the second digit of the pseudocode is greater than three,
\(\Rightarrow A\) — sending to cells \(A+0\) and \(A+1\),
\(\to\) — transfer of control.
The IS implements arithmetic and logical pseudocommands. By the indicator \(4A\), it separates codes from pseudocodes (PC). When codes are executed, cell 0023 plays the role of an accumulator. By the indicator \(K4\), logical PCs are separated from arithmetic ones. The choice of this indicator preserves, as far as possible, the customary form of commands in PC: 24, 34, 54 for transfers of control and 00, 01, 02, 03 for arithmetic operations. To refer to the SS, the commands 10, 11, 12, 13, 20, 21, 22, 23, etc. are used.
Arithmetic PCs organize calls to SPs of arithmetic operations or to SPs for computing functions. In this case \((A_1) = \to 0020\) is always executed; then, if there is no \(4A_2\), \((A_2) = \to 0022\) is executed, after which the “switch” organizes \(\to SP\). In most SPs, obtaining the result in cells 0022–23 and \(\to IS\) is provided for. If \(PC > 0\), then \((0022) = \to A_2\). Cells 0022–23 play the role of an accumulator.
Logical PCs organize the operation of the IS and, unlike arithmetic ones, can introduce certain changes into the IS. For executing logical PCs, attachments are provided, which carry out certain logical functions in a standard manner.
Basic logical PCs
(attachments are given in the appendix).
| Code | \(A_1\) | \(A_2\) | Operation |
|---|---|---|---|
| 05 | \(A_1\) | \(A_2\) | — \((A_1) = \to A_2\). |
| 15 | \(A_1\) | \(A_2\) | — \((A_1) = \to 0022,\ (0022) = \to A_2\). |
| 34 | \(A_1\) | \(A_2\) | — \(\to A_1\) or \(\to A_2\) according to the sign of \((0022)\). |
| 24 | \(A_1\) | \(A_2\) | — \(\to A_1\), the address \(A_2\) is not used. |
| 44 | \(A_1\) | \(A_2\) | — switching off the IS, \(\to A_1\) with preparation for switching on the IS from \(A_2\). |
| \(x \ne 0.\) 54 | \(A_1\) | \(A_2\) | — \(\to A_1\) when \((0022) > 0\), \(\to A_2\) when \((0022) < 0\), \(\to k + 1\) when \((0022) = 0\). |
| 64 | SPn | \(A_2\) | — pseudocommand for an array function. |
| 74 | \(A_1\) | \(m\) | — pseudocommand for a loop by counter. |
When pseudocommands 05, 24, 34, 44, 54, 74 are used, \((0022)\) is preserved.
The array-function attachment loops the IS for the \(n\)-fold computation of a one-place function with readdressing of the argument and result. The following restrictions are adopted: the SP command is less than \(40_8\), \(n < 100_8\); the SP uses an argument from cells 0022, 0023.
The loop attachment transfers control \(n - 1\) times, where \(n < 100\), to \(A_1\). The attachment makes it possible to organize a loop within a loop. After execution of pseudocodes 64, 74, the address containing \(n\) is restored. The set of attachments can be considerably expanded and used analogously to the use of the SP library.
Some questions of debugging
We shall consider the question of debugging a program composed in pseudocommands from the point of view of the most efficient use of the IS in the debugging process. Running the program after certain changes in the IS makes it possible to print the prescribed information. For example, when changing the cells
\[ \begin{aligned} 0120)&\ 54\ 0142\ 0000\\ 0142)&\ 40\ 0000\ 0114 \end{aligned} \]
a command of the form \(05,\ \text{No. }0157\) is printed, where No. is the address of the logical PC. Similarly for an arithmetic PC:
\[ \begin{aligned} 0140)&\ 26\ 0215\ 0142\\ 0141)&\ 40\ 0000\ 0114. \end{aligned} \]
To identify all transfers of control, cell
\[ 0151)\ 46\ 0005\ 0111. \]
is changed. One can trace the entire sequence of out-
calculations, by changing the instruction 0113) 40 0011 0114, it is also possible to fix certain add-ons, for example:
\[ P_4 + 3)\; 41\; 0204\; 0157 \]
\[ P_7 + 14)\; 40\; 0032\; 0000. \]
For the search for arithmetic errors, the add-ons \(P_p\) and \(P_v\) are intended; they are switched on by cell 0113) \(24\; P\; 0000\) and output to print (0022). They increase the requirements on the \(SP\) for translating \(2-10\): the \(SP\) must preserve (0022).
The add-on \(P_t\) operates after each \(PK\) and prints all intermediate results. The add-on \(P_v\) selectively prints the results of execution of those \(PK\) in which the sign \(2A_2\) is present. After the add-on is switched off, the sign \(2A_2\) does not interfere with the program’s operation, i.e., the output of check digits during debugging, or the printing of certain results in addition to the main ones, can be provided for when writing the program.
For debugging and other checks, stops at a specified pseudo-instruction may be useful. For example, a stop at addresses 114 and 115 makes it possible to read the address and the contents of the pseudo-instruction; a stop at address 107 makes it possible to follow the recording of the result \((0022) \Rightarrow A_2\); at address 152, the transfer of control according to \(PK\) 24, 34, 54. For convenience of work at the console, it is advisable to have a diagram of stops within the \(IS\).
The developed \(IS\) makes it possible, in comparison with the standard \(IS\) [3, 4], to reduce the execution time of arithmetic \(PK\) almost by half, while at the same time shortening the length of the program. This is ensured by every possible disconnection from the \(IS\), by more economical access to the \(SP\), and by the use of a set of add-ons. The \(IS\) makes it possible to switch on any \(SP\) or add-on by means of a single instruction, which considerably simplifies the programming process, bringing it closer to operator programming.
The described \(IS\) also has certain shortcomings. Thus, in our opinion, the shortcomings include the presence of two “switch” blocks (for switching on the \(SP\) and the add-ons). Certain difficulties in use are also created by the discontinuity of the control-transfer scale on the \(SP\) (especially in problems with a large number of \(SP\)).
Appendix
OPERATOR SCHEME OF THE \(IS\)
\[ \begin{array}{cccccccccccc} 13 & 1,12,14 & 14 & & & & & 8 & 6 & 5 & 10 & 11\\ \downarrow & \downarrow & \downarrow & & & & & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow\\ P_1 & Z_2 & \Phi_3 & Z_4 & P_5 & P_6 & Z_7 & P_8 & Z_9 & H_{10} & H_{11} & A_{12}\; A_{13}\; H_{14}\\ \downarrow & & & & \downarrow & \downarrow & & \downarrow & & \downarrow & \downarrow & \downarrow\;\downarrow\;\downarrow\\ 3 & & & & 12 & 11 & & 19 & & 13 & 14 & 3\;\;1\;\;3,4 \end{array} \]
| operator | instructions in the \(IS\) | action of the operator |
|---|---|---|
| \(P_1\) | 0104–0105 | if \(PK < 0\), then \(\to \Phi_3\), otherwise \(\to Z_2\). |
| \(Z_2\) | 0106–0112 | execution \((0022) \Rightarrow A_2\). |
| \(\Phi_3\) | 0113 | readdressing of operator \(Z_4\). |
| \(Z_4\) | 0114 | sending in the next pseudo-instruction. |
| \(P_5\) | 0115–0116 | if there is \(4A_1\) in the pseudo-instruction, then \(\to A_{12}\), otherwise \(\to P_6\). |
| \(P_6\) | 0117–0120 | if there is K1 in \(PK\), then \(\to H_{11}\), otherwise \(\to Z_7\). |
| \(Z_7\) | 0121–0125 | execution \((A_1) \Rightarrow 0020\). |
| \(P_8\) | 0126–0127 | if there is \(4A_2\) in \(PK\), then \(\to H_{10}\), otherwise \(\to Z_9\). |
| \(Z_9\) | 0130–0135 | execution \((A_2) \Rightarrow 0022\). |
| $H_{10}$ | 0136—0141 | switch for $SP$. |
| $H_{11}$ | 0143—0147 | switch for prefixes. |
| $A_{12}$ | 0156—0160 | execution of code and $\to \Phi_3$. |
| $A_{13}$ | — | execution of $SP$ and $\to P_1$. |
| $H_{14}$ | — | execution of prefix and $\to \Phi_3$ or $\to \mathcal{E}_4$. |
Standard constants and $SP$ of arithmetic operations have been changed in the following cells:
| 0041 | —16 | 0021 | 0023 | 0075 | 11 | 0020 | 0022 |
| 0061 | —17 | 0145 | 0023 | 6 | 20 | 0012 | 0020 |
| 0070 | 00 | 0000 | 0036 | 7 | 17 | 0145 | 0023 |
| 1 | 24 | 0104 | 0000 | 0100 | 32 | 0021 | 0000 |
| 2 | 00 | 0022 | 0020 | 1 | 25 | 0000 | 0022 |
| 3 | 13 | 0021 | 0023 | 2 | 00 | 0020 | 0022 |
| 4 | 34 | 0101 | 0101 |
Program $IS$
| 0103 | 05 | 0071 | 0067 | 0140 | —26 | 0215 | 0141 |
| 4 | 16 | 0003 | 0157 | 1 | |||
| 5 | 34 | 0106 | 0113 | 2 | |||
| 6 | 16 | 0006 | 0157 | 3 | 05 | 0157 | 0111 |
| 7 | —26 | 0205 | 0111 | 4 | 36 | 0204 | 0000 |
| 0110 | 20 | 0013 | 0112 | 5 | —37 | 0137 | 0001 |
| 1 | 6 | —26 | 0214 | 0147 | |||
| 2 | 7 | ||||||
| 3 | 00 | 0011 | 0114 | 0150 | —07 | 0115 | 0111 |
| 4 | 05 | No. | 0157 | 1 | 16 | 0005 | 0111 |
| 5 | 36 | 0161 | 0014 | 2 | —36 | 0206 | 0000 |
| 6 | 54 | 0156 | 0000 | 3 | 24 | 0114 | 0114 |
| 7 | 16 | 0164 | 0157 | 4 | 16 | 0167 | 0111 |
| 0120 | 54 | 0143 | 0000 | 5 | —26 | 0207 | 0157 |
| 1 | 16 | 0005 | 0157 | 6 | 05 | 0023 | 0023 |
| 2 | —26 | 0165 | 0124 | 7 | |||
| 3 | 20 | 0013 | 0125 | 0160 | 24 | 0113 | 0023 |
| 4 | 1 | 00 | 4000 | 0003 | |||
| 5 | 2 | 00 | 0000 | 2000 | |||
| 6 | 16 | 0163 | 0157 | 3 | 00 | 0000 | 4000 |
| 7 | 54 | 0136 | 0000 | 4 | —04 | 0000 | 0200 |
| 0130 | 16 | 0006 | 0157 | 5 | 05 | 0000 | 0020 |
| 1 | —37 | 0115 | 0014 | 6 | 05 | 0000 | 0022 |
| 2 | —26 | 0166 | 0134 | 7 | 77 | 0000 | 0000 |
| 3 | 20 | 0013 | 0135 | 0170 | 24 | $P_0$ | 0300 |
| 4 | 1 | 24 | $P_1$ | 0000 | |||
| 5 | 2 | 24 | 0151 | 0003 | |||
| 6 | 16 | 0167 | 0157 | 3 | 24 | 0154 | 0000 |
| 7 | —37 | 0131 | 0017 | 4 | 24 | $P_4$ | 0000 |
| 0175 | 24 | 0154 | 0000 | 0207 | 00 | 0151 | 0150 | |
| 6 | 24 | $\Pi_j$ | 0030 | 0210 | ||||
| 7 | 24 | $I_i$ | 0000 | 1 | ||||
| 0200 | 24 | 0041 | 0000 | 2 | ||||
| 1 | 24 | 0340 | 0000 | 3 | ||||
| 2 | 24 | 005 | 0000 | 4 | 24 | 0170 | 0000 | |
| 3 | 24 | 0072 | 0000 | 5 | 24 | 0200 | 0000 | |
| 4 | 70 | 0203 | 0000 | 6 | 00 | 0011 | 0114 | |
| 5 | 05 | 0022 | 0600 | 7 | -02 | 7776 | 0040 | |
| 6 | 05 | 0000 | 0157 |
Insertions
| $I_0+0$ | 05 | 0157 | 0111 | $I_7+0$ | -17 | 0131 | 0114 |
| 1 | 24 | 0110 | 0000 | 1 | -24 | $\Pi_7+13$ | $\Pi_4+2$ |
| $I_1+0$ | 16 | 0005 | 0157 | 2 | 00 | 0000 | 0000 |
| 1 | -26 | 0166 | $I_1+3$ | 3 | -37 | $I_7+4$ | 0006 |
| 2 | 20 | 0113 | $I_1+4$ | 4 | 54 | 0151 | 0030 |
| 3 | 00 | 0000 | 0000 | $I_7+5$ | 16 | 0006 | 0157 |
| 4 | 00 | 0000 | 0000 | 6 | -27 | $I_7+3$ | 0020 |
| 5 | 24 | 0106 | 0000 | 7 | -17 | 0131 | 0114 |
| $I_2+0$ | 16 | 0006 | 0157 | 10 | -24 | $I_7+14$ | $\Pi_7+11$ |
| 1 | -37 | 0115 | 0000 | 11 | 00 | 0000 | 0000 |
| 12 | 24 | 0113 | 0000 | ||||
| 2 | -26 | 0206 | 0114 | 13 | 01 | 0017 | 0000 |
| 3 | -11 | 0204 | 0157 | 14 | -01 | 0025 | 0000 |
| 4 | 24 | 0157 | 0157 | $\Pi_8+0$ | 10 | $I_8+0$ | 0017 |
| $I_3+0$ | 05 | $\Pi_4+12$ | 0113 | 1 | 24 | SI | 0113 |
| 1 | -17 | $\Pi_3+6$ | 0157 | 2 | 01 | 0014 | 0113 |
| $\Pi_3+2$ | 26 | 0167 | 0020 | $\Pi_{11}+3$ | 10 | 0011 | 0114 |
| 3 | 16 | $\Pi_5+13$ | 0157 | 4 | 24 | 0114 | 0114 |
| 4 | -26 | 0020 | 0157 | $\Pi_{13}+0$ | 16 | 0162 | 0157 |
| 5 | 01 | $\Pi_5+14$ | 0157 | 1 | 54 | $I_{13}+4$ | 0000 |
| 6 | 36 | 0005 | 0006 | 2 | 10 | 0011 | 0114 |
| 7 | 54 | 0130 | 0000 | 3 | 24 | 0114 | 0114 |
| 10 | 05 | 0216 | 0113 | 4 | 10 | $\Pi_k+4$ | 0017 |
| 11 | 24 | 0130 | 0000 | 5 | 24 | SI | 0113 |
| 12 | 24 | $\Pi_6+5$ | 0000 | 6 | 05 | 0216 | 0113 |
| 13 | 06 | 0077 | 7777 | 7 | 24 | $\Pi_{\mathrm{v}}+2$ | 0000 |
| 14 | 00 | 0000 | 7776 |
Literature
-
Report on the abbreviated “Algol-60,” IFIP, Journal of Computational Mathematics and Mathematical Physics, vol. 5, no. 3, 1965, p. 575.
-
E. A. Zhogolev. The “POLIZ-63” interpreter, Journal of Computational Mathematics and Mathematical Physics, vol. 5, no. 1, 1965, p. 67.
-
Library of standard subroutines for the “Minsk-1” electronic digital computer. Minsk, 1961.
-
N. N. Lozinskii et al. Programmer’s Handbook, vol. 2, 1964.