Elektronika B3-34

How to calculate on the

Elektronika B3-34

PART 2

Russian version

Continuation of the story how to work with the programmed calculator A3-34. A beginning of the story here.

During calculations there can be a message on a error at overflow or performance of incorrect operation:

In the calculator 14 registers of memory are used. They have numbers 0-9, A-D (in MK-61 and MK-52 there is an additional register E).

The reading from the register is made in the register X. Records in the registers is made also from the register X. For record of number from the register X in the register of memory the key (M - memory) is used. For extraction of number from the register of memory the key (RM - recall memory) is used. For example, to write down number 3 in the register 8, it is necessary to press keys . The number is similar is taken from memory.

Above was already told, that for performance of double operations the registers X and Y are used, and for moving number to the register Y the key is used. However only to moving from the register X in the register Y of action are not limited. Below in the table the principles of moving of the information in noaea are shown. Do not forget, that the register X is an indicator.

Recall from memory, set on the keyboard after performance of operation (except and , finishing entering)

Contunue entering by keyboard after or .

Presing key .

Performance of monadic operation and .

Performance of two-local operation.

Extraction of contents of the register X1.

Stack scroll.

.

Swap contents of registers X and Y.

We shall consider commands of transition further (branch).

For unconditional transition to the address of the program the key (GoTo - unconditional transition) is used. After a command it is necessary to specify the address of transition. For example, to jump to the address 60, it is necessary to press keys: . This command works both in a mode of hand-operated calculations, and in a program mode. In a program mode such command occupies two cells of memory: the first cell - code of a command of transition, second - address of transition.

To cause the subroutine, the command (GoSub - Go to the Subroutine) is used. The same as and in a command of unconditional transition, it is necessary to specify the address, with which the subroutine begins. A command of return from the subroutine - . The subroutines can be put each other. All up to five levels of an enclosure of the subroutines are admitted.

Also there are special commands, which change the order of performance of the program depending on contents of the register X. It is commands . If the condition is carried out, program jump to a command following a command of a condition, otherwise - control will be transferred to the specified address.

For example, if from the address 20 we shall enter a line: 20. 21. , if contents of the register X will be less than zero, the program will proceed from the address 22, and if the zero and is more, from the address 25.

For organization of cycles reserved special commands: . After input of these commands also it is necessary to specify the jump address. Each command is associated with the registers from 0 up to 3 accordingly. After pass of a command there is a subtraction of unit from this register and comparison of result to zero. If the result is equal to zero, the program will continue running to the next address. Differently - will pass on the specified address of jump adress.

Let's write a little program of calculation of factorial.

At first we shall go in a programming mode: (jump to the address 00) . The next is entered the program:

00. 01. 02. 03. 04. 05. 06.

When the program is written, we pass in a mode of automatic work: .

The number is entered from the keyboard and pressing key (goto 00) and (start). Number shiuld be in a range from 1 up to 69.

Now we shall consider index commands.

The index commands begin with pressing of a key and always occupy one cell of memory. After pressing a key entering one of commands b-p.jpg (917 bytes) b-p.jpg (917 bytes) b-p.jpg (917 bytes) b-p.jpg (917 bytes) and number of the register.

Before performance of action the value of the register is modified. If number of the register 0, 1, 2, 3, before performance of action its value decreases by 1. If number of the register is equal 4, 5, 6, the value of the register is increased by 1. Other registers do not change.

To the register A there assotiating number 10, B - 11, C - 12, D - 13 (in MK-61 and MK-52, E - 14). command.

Command will place contain of register X into register, which number placed in the register 0 but decreaces by 1.

Command will place contain of register which number placed in the register 4 but increased by 1 into register X.

Command will jump work of the program to the address specified in the register 9. Similarly transition to the subroutine, which address is specified in the register B, is carried out by a command .

Command is similar to a command XX but the jump adress given from register A and command occupied one cell only.

Here it is necessary to pay attention, that if in the register to place fractional number, and then to this register to apply a command of an indirect call, from the placed number the fractional part will be rejected.

For example, by placing number 12.34567 in the register 9 and passing command , in the register 9 there will be number 00000012. This interesting feature is very convenient for branch of the whole part of number.

More details about other undocumented and interesting functions of the calculator B3-34 look on special page.

 

© Sergei Frolov, 1998-2000

Last modified: 2000-05-02.

. 1