T 0 Z 0 Y 0 X 0
[โ]
key. It copies the contents of register X into register Y, the value of register Y in Z, Z in T, and the value found in T is lost. That is, if before pressing the [โ]
button in the registers there were values T 5 Z 8 Y 14,5 X 6
, T 8 Z 14,5 Y 6 X 6
[F] [.]
.[]
command swaps the contents of the X and Y registers.[CX]
command erases the contents of register X.[Xโ]
and [โX]
. The first command places the contents of register X into the appropriate addressable register. For example, the sequence of commands [4] [Xโ] [0]
places the number 4 in the RG0 register. The second command, as you already guessed, copies the contents of the addressable register into the X register. That is, [โX] [0]
will put X number 4.[2] [โ] [3] [+]
. In this case, the values โโof the registers change as follows: T 8 Z 14,5 Y 6 X 0
[2] [โ] [3]
: T 14,5 Z 6 Y 2 X 3
[+]
: T 14,5 Z 14,5 Y 6 X 5
[15] [โ] [2] [โ] [5] [/] [+] [7] [*] [10] [+]
.[F] []
. 00 appears on the display. This indicates the current command number. In general, the program in MK-61 is a sequence of commands necessary to solve the problem. This is usually arithmetic operations, numbers, sometimes special codes of cycles and branching. In total, the program may consist of no more than 105 commands, which are numbered from 00 to 99. To enter a command, you must press the corresponding key. Here is the table of matching codes and keys of the calculator:02 01 0E 06
on the display means:06
- address of the next command entered0E, 01, 02
- three consecutive commands located respectively at addresses 03, 04, 05.[F] []
) (we assume that the radius of the circle is in the RG1 register): // โ , 00 [โX] [1] // RG1 X (61) 01 [F] [*] // (22) 02 [F] [+] // X (20) 03 [*] // X Y (12) 04 [/] // ( ) (50)
[F] [/-/]
, and then we need to press the [/]
key to go to the beginning of the program. Put the number 5 in the register RG1 ( [5] [Xโ] [1]
) and press [/]
to start execution. After the calculator has passed all the steps, the number 78,539815 should appear on the screen - the area of โโa circle with a radius of 5.[]
command (51) you can perform an unconditional perezod (goto) at the desired address. To do this, in programming mode, press []
and then two digits of the address we want to go to. When the calculator reaches this operator while executing the program, it will continue execution from the command at the specified address. For example: ... 10 [F] [-] // 21 11 [] // 51 12 [4] [2] // (42) ... 42 [+] // 10
[X >= 0]
, [X < 0]
, [X = 0]
and [X != 0]
. Using these commands, the contents of register X are checked for the condition. If the condition is not met, control passes to the address specified after the operator, otherwise (if the condition is met) the address is ignored and the program continues to function normally. For example: ... 09 [F] [*] // 22 10 [F] [โ] // "if (X == 0)" (5E) 11 [4] [2] // , , 42 (42) 12 [+] // , X = 0 (10) ... 42 [4] // 04
[F] [โX]
, [F] [Xโ]
, [F] []
and [F] []
). These commands operate on the contents of the registers RG0-RG3, respectively. Each time the loop command is executed, 1 is subtracted from the contents of the corresponding register and compared with zero. If the contents of the register are not equal to zero, a transition occurs to the address written after the cycle command, if equal, then a transition occurs to the command following the cycle transition address. To make it clearer, let's look at an example. We will assume the factorial of the number in register X. // RG0 , RG1 . 00 [Xโ] [0] // X RG0 - (40) 01 [1] // 1 X (01) 02 [Xโ] [1] // RG1 - (41) 03 [โX] [1] // (61) 04 [โX] [0] // (60) 05 [*] // (12) 06 [Xโ] [1] // (41) 07 [F] [โX] // L0 - . ... (5) 08 [0] [3] // ... 03... (03) 09 [/] // ... - (50)
Source: https://habr.com/ru/post/111099/
All Articles