Elektronika MK-52

The Elektronika MK-52 () is an RPN-programmable calculator manufactured in the Soviet Union during the years 1983 to 1992. It belongs to the third generation of Soviet programmable calculators. Its original selling price was 115 rubles.
The functionality of the MK-52 is identical to that of the Elektronika MK-61, except that the MK-52 has an internal non-volatile EEPROM memory module for permanent data storage, a diagnostic slot, and a slot for ROM modules. The programming language and functionality of the MK-52 and MK-61 calculators were extensions of the earlier MK-54, B3-34, and B3-21 Elektronika calculators. The MK-52 is the only calculator known to have internal storage in the form of an EEPROM module.
As with many Soviet calculators, the MK-52 has a number of undocumented functions. In November 1988, the MK-52 went into space on the Soyuz TM-7 spacecraft, where it could have been used to calculate the trajectory of landing in the event of an onboard computer failure.
Architecture.
The MK-52 has 105 steps of volatile program memory, an internal EEPROM module (with 512 bytes of memory), and 15 7-byte registers. It uses four AA-size battery cells or can be plugged into a power adapter. It has a relatively dim, ten-digit (8 digit mantissa, 2 digit exponent) green vacuum fluorescent display. The MK-52 has an expansion port to which various ROM (Read-only memory) modules could be attached. Its system clock speed is approximately 75 kHz (derived from a phases generator chip), and it weighs approximately 400 grammes.
The MK-52 is the first Soviet micro-calculator with non-volatile electrically erasable memory (EEPROM, type KR1601RP1, with a capacity of 4 kilobits, and capable of 10,000 rewrites), ensuring security for programs, and for the clipboard, when the power is turned off. This EEPROM memory is capable of storing up to 512 1-byte program words (or the contents of 72 7-byte registers) and exchanging its contents with the calculator's RAM.
The calculator is fully compatible with the second-generation models (B3-34 and MK-54), using the same command system and machine codes. On average, a program that takes all 105 steps of program memory and 15 registers on the MC-52 will be equivalent in capability to approximately 140-150 steps and 18 registers on the B3-34. Additionally, the MC-52 has an extended set of commands that can allocate integer and fractional parts of numbers, search for absolute and maximum values of numbers, and perform certain logical operations. 
Electric current requirements.
In standby mode (when the screen is illuminated zero) - about 89 mA,
In memory mode (execution of the program codice_1, resulting in the indicator showing only the luminous decimal point) - about 84 mA,
In counting mode, in accordance with the program - 73 mA.
ROM.
In addition, you can connect an external ROM which is a memory expansion unit with stored games and mathematical programs, produced by the manufacturer, that constitute the user library. Manufacturers have produced 4 types of ROM cartridges, three of them containing various mathematical functions, and one, the BRP-4, containing game programs:
BRP-2 "Astro" (Russian: БРП-2 "Астро"), with a set of programs for navigational tasks, information about which was published in issue 12, of 1988, of the Russian-language monthly magazine "" ("Marine Digest");
BRP-3 (Russian: БРП-3), containing 60 programs for solving mathematical problems. In 1988, 15,200 units of this ROM were manufactured, and were sold at a price of 16 rubles;
BRP-4 (Russian: БРП-4) was produced in 1989, containing game programs;
GRP "Geo".
There is another expansion jack in the MK-52, which serves to run diagnostics on the calculator during its production, and which could connect the calculator to external devices and their controllers, such as an external printer.
Basic operations.
The MK-52 has two main modes of operation: automatic mode and programming mode. General calculations and operations are performed in automatic mode, while programs are fed as input in programming mode. The keystroke sequence codice_2 codice_3 (codice_4 in appearance) switches the MK-52 to automatic mode, while codice_2 codice_6 (codice_7) switches it to programming mode.
Manual calculations in automatic mode are in accordance with Reverse Polish Notation logic. For example, to evaluate 2+3, the following keystrokes are required: codice_8 codice_9 (looks like codice_10) codice_11 codice_12.
Bitwise binary operations.
The MK-52 is fully capable of performing Boolean operations on binary numbers. The following example demonstrates the OR logical operation on the binary numbers codice_13 and codice_14:
Binary numbers are input into the calculator as hexadecimal numbers prepended by an codice_15.
First, the operator must divide the numbers into groups of four digits, adding leading zeros if necessary, e.g. splitting codice_13 into groups of four gives codice_17 and codice_18. The equivalent hexadecimal values of these two four-digit binary numbers are codice_19 and codice_15, respectively, which equal hexadecimal codice_21.
Similarly, codice_14 is equivalent to hexadecimal codice_23.
So, the numbers codice_24 and codice_25 are entered into the MK-52 and the OR operation is performed on them. The OR operation is achieved by pressing the codice_26 key, then codice_3 (which looks like codice_4).
The result displayed should be codice_29, which translates into binary codice_17 and codice_31, and, hence, the binary number codice_32, which is the result.
The following list details the MK-52's graphical representation of hexadecimal numbers:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -, L, C, Г, E, (blank). Normal hexadecimal representation is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Programming.
The MK-52's programming commands are typed into the MK-52 in programming mode and are then executed. The MK-52 is fully capable of being programmed to manage memory and to use both conditional and unconditional branching.
In programming mode, the screen displays information about the program in memory, represented by two hexadecimal-digit operation codes. For example, if codice_33 is displayed, then this means that codice_34 is stored at program step 00, codice_35 is stored at program step 01, codice_36 is stored at program step 02, and the machine is prompting for data to be input, to be stored at program step 03.
Saving to EEPROM.
Before entering a program to volatile memory with the intention of saving this program to EEPROM memory, the EEPROM program space to be saved to must be cleared first, which clears the volatile memory as well as the selected area of the EEPROM memory.
Each program step requires 1 byte of memory and each data register requires 7 bytes of memory.
When clearing, reading, or writing to the EEPROM memory, the address and range are specified by a six-digit number, preceded by a non-zero number, in automatic mode: e.g. codice_37 specifies that codice_38 bytes are to be stored starting at memory address codice_39. A two-position data/program switch controls whether data (from the registers) or program memory is transferred; a three-position switch is used to select read, write, and clear operations.
Additional information.
Price.
Its original selling price was 115 rubles.
Colours.
The MK-52 was made available in a variety of colours, including black and grey, turquoise and blue, white and grey, and orange.
Schematics.
In what would be considered an unusual practice today (but was common for Soviet electronics), technical schematics were provided for the MK-52 when it was purchased, facilitating user modification and repair of the machine.
Error message.
When an error was encountered on the machine, the display produced a message similar to the English word "error". The word, written in this fashion, cut down on the number of display segments used to display the error message. In Russian, this spelling is not pronounced "error", but "eggog".
Games.
There is a host of games available for the MK-52. The MK-52's undocumented functions tend to be heavily used in the games due to their ability to make unusual calculations and produce specialised displays. A simple example of the modification of the display is accomplished by the repeated squaring of (and ignoring error messages).
Use in outer space.
In November 1988, the MK-52 went into space on the Soyuz TM-7 spacecraft, where it could have been used to calculate the trajectory of landing in the event of an onboard computer failure.
Bugs.
There is currently only 1 known bug in the MK-52: that the MAX function gives a result of zero if one of the two arguments of the function is zero.