1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html40/strict.dtd">
3 <title>Minsk-2 Emulator</title>
4 <link rel=stylesheet title=Default href="minsk.css" type="text/css" media=all>
6 <h1>Minsk-2/Minsk-22 Emulator</h1>
8 <p id=top>(see it <a href='.'>in action</a>)
12 <p>This is an emulator of the Минск-2 (Minsk-2) and Минск-22 (Minsk-22) –
13 mainframe computers from the Soviet era, produced around 1963 and 1965 respectively,
14 in the Byelorussian SSR.
16 <p>The Minsk-2 emulator was originally written for a task in the
17 <a href='http://podrate.ucw.cz/'>Po drátě</a> hacking contest (sorry, the page is in
18 Czech only). The participants were to find a password hidden in the machine's memory,
19 which involved figuring out how the machine works and reconstructing at least a part
20 of its instruction set.
21 You can try your luck, the password is still there.
23 <p>Online resources about these machines are rather scarce. English Wikipedia contains
24 a fairly short article on the <a href='http://en.wikipedia.org/wiki/Minsk_family_of_computers'>Minsk
25 family of computers</a>, Russian Wikipedia reveals a couple of technical details on
26 <a href='http://ru.wikipedia.org/wiki/%D0%9C%D0%B8%D0%BD%D1%81%D0%BA-22'>Minsk-22</a>,
27 which is essentially Minsk-2 with extra memory. The Russian Virtual Computer Museum
28 tells the <a href='http://www.computer-museum.ru/english/minsk0.htm'>history of the
29 Minsk family</a> in its full glory, but it lacks details. The best resource we could
30 find is the book Programmirovanije dlja ECBM Minsk-22 by V. M. Salikov, and the emulator
31 is based solely on that plus a bit of guesswork.
33 <p>We have written a <a href='INSTRUCTIONS'>brief description of the instruction set</a>
34 for our own reference.
36 <p>When using the emulator, please make sure that your browser is able to display
37 Cyrillic letters, as all error messages are printed in Russian. (This is not historically
38 accurate, the real machine never printed error messages – it used signal lights on the
39 control panel instead.)
43 <p>We have tried to get as close to the behavior of the real machines as we could,
44 but the description in the Salikov's book is not as detailed as we would wish,
45 so several things remained to be guessed. Here is a list of likely differences
46 against the real Minsk-2/Minsk-22:
49 <li>Rounding of fixed-point and floating-point computations is likely to be different.
50 <li>Arithmetic overflow is always fatal.
51 <li>Exact behavior of negative zero is unknown. We always produce positive zero as a result.
52 <li>Contents of the R1 and R2 registers displayed when the program stops probably
53 differ from the real front panel. However, the behavior visible to the program
55 <li>Among the rich set of I/O devices, only the line printer is implemented.
56 <li>Malformed instructions are probably handled differently.
61 <p>The input to the emulator follows a fairly simple format:
63 <pre id=output><code>; An example
75 <p>Empty lines and lines starting with a semicolon are ignored.
76 <code>@xxxx</code> sets the memory address (in octal), all other
77 lines specify signed 36-bit octal values to be written to consecutive
78 memory cells. Spaces inside numbers are purely decorative and the parser
83 <p>Here is a couple of easy example programs for you to try:
86 <li><a href='.?example=hello'>Hello, world #1</a>
87 <li><a href='.?example=hello2'>Hello, world #2</a>
88 <li><a href='.?example=arith'>Aritmetics</a>
89 <li><a href='.?example=loop'>A simple loop</a>
92 <h2>Author and copyright</h2>
94 <p>The Minsk-2 emulator has been written by <a href='http://mj.ucw.cz/'>Martin Mareš</a>
95 in 2010 and it is copyrighted by its author.
97 <p>Minsk-22 emulation and some other changes were added by
98 <a href='https://www.linkedin.com/in/rutgervanbergen/'>Rutger van Bergen</a> in
101 <p>The program is free software. You can freely use it and distribute it under the terms of the
102 <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU General Public License version 2</a>.
104 <p>Bug reports and suggestions are welcome (especially from people who have encountered
105 the real Minsk), please contact the author by e-mail at <a href='mailto:mj@ucw.cz'>mj@ucw.cz</a>.
109 <p>You can download the <a href='http://mj.ucw.cz/download/minsk/'>source code of the emulator</a>.
113 <p>The emulator has been developed on Linux with GCC and it should build and run on all POSIX systems,
114 possibly requiring trivial modifications.
116 <p>On a system with the GNU toolchain installed, the emulator can be built by running the following
122 <h2><a id="use">Use</a></h2>
124 <p>The emulator reads its input from stdin. Loading and executing the ex-hello example program
125 would therefore be done like this:
127 $ ./minsk < ex-hello
130 <p>The list of supported options can be acquired by running the emulator with any