What is a computer command system? Computer command system and methods of accessing data

An important component of computer architecture is the instruction system. Despite the large number of types of computers, at the lowest (“machine”) level they have much in common. The command system of any computer necessarily contains the following groups of information processing commands.

1. Data transfer commands (census), copying information from one place to another.

2. Arithmetic operations, to which computer technology actually owes its birth. Of course, the share of computational actions in a modern computer has noticeably decreased, but they still play an important role in programs. Note that the basic arithmetic operations usually include addition and subtraction (the latter, inside the processor, most often also comes down to addition in one way or another). As for multiplication and division, in many computers they are performed using special programs.

3. Logical operations, allowing the computer to analyze the information received. After executing such a command, using a conditional jump, the computer is able to select the further course of program execution. The simplest examples of commands of the group under consideration are comparison, as well as the well-known logical operations AND, OR, NOT (inversion), described earlier in paragraph 1.4. In addition, analysis of individual code bits, their reset and installation are often added to them.

4. Shifts binary code left and right. To prove the importance of this group of commands, it is enough to recall the rule of column multiplication: each subsequent product is written in such a scheme with a shift of one digit to the left. In some special cases, multiplication and division can generally be replaced by a shift (remember that by adding or removing a zero to the right, i.e., actually shifting a number, you can increase or decrease it by 10 times).

5. Input and Output Commands information for exchange with external devices. In some computers, external devices are special service memory addresses, so input and output is carried out using census commands.

6. Control commands, implementing nonlinear algorithms. This primarily includes conditional and unconditional jumps, as well as commands for calling a subroutine (jump with return). Some computers have special commands for organizing cycles, but this is not necessary: any the cycle can be reduced to one or another combination of conditional and unconditional transitions.

Often this same group of commands includes processor control operations such as stop or NOP - no operation. Sometimes they are separated into a special group. As the complexity of the processor device increases, the number of such instructions increases.

Any computer command usually consists of two parts - operating room And address. The operating part (otherwise it is called operation code - COP) indicates what action needs to be performed on the information. The address part describes where the information used is stored and where the result should be placed. Some few commands for controlling the operation of the machine may have no address part, for example, in the stop command; the operating part is always available.

An operation code can be thought of as a certain conventional number in the general list of command systems. Basically, this list is built in accordance with certain internal patterns, although they are not always obvious.

The address part has much greater variety and should be considered in more detail.

First of all, note that commands can be one-, two- and three-address depending on the number of possible operands.

The first computers had the simplest and most intuitive three-address command system. For example: take numbers from memory addresses A1 and A2, add them and place the sum in address A3. If an operation required a smaller number of addresses, then the extra ones were simply not used. Let's say that in the census operation only the source and receiver cells of information A1 and A3 were indicated, and the contents of A2 had no meaning.

The three-address command was easy to decipher and was convenient to use, but as the amount of RAM grew, its length became prohibitively large. Indeed, the length of such a command is the sum of the length of three addresses and the operation code. It follows, for example, that for a modest RAM of 1024 cells, only writing the address part requires 3 * 10 = 30 binary bits, which is not very convenient for technical implementation. Therefore, two-address machines appeared, in which the length of the command was reduced by eliminating the address for recording the result. In such computers, the result of the operation remained in a special register ( adder) and was suitable for use in subsequent calculations. In some machines, the result was written instead of one of the operands.

Further simplification of the command led to the creation of unicast machines. Let us consider the command system of such a computer using a specific simple example. Suppose we need to add the numbers stored in RAM addresses A1 and A2, and place the sum in A3. To solve this problem, a unicast machine will need to run three commands:

  1. extract the contents of cell A1 into the adder;
  2. add the adder with the number from A2;
  3. write the result from the adder to A3.

It might seem that a unicast machine would require three times as many commands to complete a task as a three-address machine. In fact, this is not always the case. Try to plan your own program for calculating the expression Y=(X1+X2)*X3/X4 and you will be surprised to find that you will need 3 three-address commands and only 5 unicast ones. Thus, a unicast machine is in some ways even more efficient, because it does not make unnecessary writes to intermediate results memory.

For the sake of completeness, it should be said about the possibility of implementing an addressless (zero-address) machine that uses a special way of organizing memory - stack. Understanding the principles of such a machine would require some fairly detailed explanations; At the same time, now addressless computers are practically not used. Therefore, we will limit ourselves to just mentioning the fact that a command system arranged in a similar way was the basis of some programmable microcalculators such as “B3-21” and “B3-34” and the like.

© E.A.Eremin, 1997
From book:
Eremin E.A. How a modern computer works. - Perm: publishing house PRIPIT, 1997. 176 p.

An important component of computer architecture is the instruction system. Despite the large number of types of computers, at the lowest (“machine”) level they have much in common. The command system of any computer necessarily contains the following groups of information processing commands.

1. Data transfer commands (census), which copy information from one place to another.

2. Arithmetic operations, to which computer technology actually owes its name. Of course, the share of computational actions in a modern computer has noticeably decreased, but they still play an important role in programs. Note that the basic arithmetic operations usually include addition and subtraction (the latter ultimately most often also reduces to addition in one way or another). As for multiplication and division, in many computers they are performed using special programs.

3. Logical operations that allow the computer to analyze the information being processed. The simplest examples are comparison, as well as the well-known logical operations AND, OR, NOT (inversion). In addition, analysis of individual code bits, their reset and installation are often added to them.

4. Binary code shifts left and right. To prove the importance of this group of commands, it is enough to recall the rule of column multiplication: each subsequent product is written in such a scheme with a shift of one digit to the left. In some special cases, multiplication and division can generally be replaced by a shift (remember that by adding or removing a zero to the right, i.e., actually shifting a decimal number, you can increase or decrease it by 10 times).

5. Commands for input and output of information for exchange with external devices. In some computers, external devices are special service memory addresses, so input and output is carried out using census commands.

6. Control commands that implement nonlinear algorithms. This primarily includes conditional and unconditional jumps, as well as commands for calling a subroutine (jump with return). Some computers have special commands for organizing loops, but this is not necessary: ​​a loop can be reduced to one or another combination of conditional and unconditional transitions. Often, this same group of commands includes a few operations to control the processor, such as “stop” or NOP (“no operation”). Sometimes they are separated into a special group.

As the complexity of the processor device increases, the number of commands that analyze the state of control bits and act on them also increases. Here, as an example, we can name the processor operating mode bits and the control bits for interrupt mechanisms from external devices.


Recently, an increasingly important role in the command set is played by commands for converting from one data format to another (for example, from 8-bit to 16-bit, etc.), which significantly simplify the processing of data of various types, but in principle can be replaced by a sequence of several simpler commands.

Considering the command system, one cannot fail to mention two modern mutually competing directions in its construction: a computer with a full set of commands CISC (Complex Instruction Set Computer) and with a limited set - RISC (Reduced Instruction Set Computer). The division arose due to the fact that most of the time the computer has to execute a small part of its set of instructions, while the rest are used sporadically (one popular article jokingly phrases this in the form of the following visual analogy: “20% of the population drinks 80% of the beer.” ). Thus, if you significantly limit the set of operations to the simplest and shortest, but carefully optimize them, you will get a fairly efficient and fast RISC machine. True, you will have to pay for speed by the need to implement “discarded” commands in software, but often this payment is justified: for example, for scientific calculations or computer graphics, speed is much more important than programming problems. Issues related to the instruction system of modern microprocessors will be discussed in more detail later in this chapter.

To summarize, we emphasize once again that the basic set of commands has changed quite little during the rapid evolution of computers. At the same time, the methods of indicating the address of the location of information in memory have undergone significant changes and deserve special consideration.

A computer command usually consists of two parts - operational and address. The operational part (otherwise called the operation code - OPC) indicates what action needs to be performed with the information. The address part describes where the information used is stored. Several few commands for controlling the operation of the machine may have no address part, for example, in the stop command; the operating part is always there.

An operation code can be thought of as a certain conventional number in the general list of command systems. Basically, this list is built in accordance with certain internal patterns, although they are not always obvious.

The address part has much greater variety and should be considered in more detail.

First of all, we note that instructions can be one-, two-, or three-address, depending on the number of operands involved in them.

The first computers had the simplest and most intuitive three-address command system. For example: take numbers from memory addresses A1 and A2, add them and place the sum in address A3. If an operation required a smaller number of addresses, then the extra ones were simply not used. Let's say that in the census operation only the source and receiver cells of information A1 and A3 were indicated, and the contents of A2 had no meaning.

The three-address command was easy to decipher and was convenient to use, but as the amount of RAM grew, its length became prohibitively large. Indeed, the length of the command is the sum of the length of three addresses and the operation code. It follows, for example, that for a modest RAM of 1024 cells, just writing the address part of one command requires 3 * 10 = 30 binary bits, which is not very convenient for technical implementation. Therefore, two-address machines appeared, in which the length of the command was reduced by eliminating the address for recording the result. In such computers, the result of the operation remained in a special register (adder) and was suitable for use in subsequent calculations. In some machines, the result was written instead of one of the operands.

Further simplification of the command led to the creation of unicast machines. Let us consider the command system of such a computer using a specific simple example. Suppose we need to add the numbers stored in cells with RAM addresses A1 and A2, and place the sum in the cell with address A3. To solve this problem, a unicast machine will need to run three commands:

Extract the contents of cell A1 into the adder;

Add the adder with the number from A2;

Write the result from the adder to A3.

It might seem that a unicast machine would require three times as many commands to complete a task as a three-address machine. In fact, this is not always the case. Try to plan your own program for calculating the expression A5 = (A1 + A2)*AZ/A4 and you will find that you will need three three-address commands and only five unicast ones. Thus, a unicast machine is in some ways even more efficient, since it does not write unnecessary intermediate results to memory.

For the sake of completeness, it should be said about the possibility of implementing an addressless (zero-address) machine that uses a special way of organizing memory - a stack. Understanding the principles of such a machine would require some fairly detailed explanations. Nowadays, addressless computers are practically not used. Therefore, we will limit ourselves to just mentioning the fact that a command system arranged in a similar way was the basis of some programmable microcalculators (for example, such as “BZ-21” and “BZ-34” and the like).

Until now, in describing the structure of a machine instruction, we have used the intuitive concept of the address of information. Let us now consider the issue of addressing RAM elements in more detail and strictly. Memory was most simply organized in computers of the first two generations. It consisted of individual cells, the contents of each of which were read or written as a single unit. Each memory cell had its own number, which was called the address. Obviously, the addresses of neighboring RAM cells are consecutive integers, i.e. differ by one. The computers under consideration used data of only one type (real numbers), and their length was equal to the length of the machine instruction and coincided with the capacity of the memory and all other devices of the machine. For example, we point out that the cell of a typical second-generation computer consisted of 36 binary bits.

Very often, a program was intended to process, using the same formulas, a certain amount of the contents of sequentially located cells (in high-level languages, such structures were later called arrays). The first two generations of computers provided special mechanisms for cyclic processing of information arrays. For this purpose, in machine instructions, in addition to regular addresses, it was possible to use modifiable addresses in which a special control bit was set to one. When the command was executed, the modified addresses marked in this way were added with the value from special index cells. By changing the contents of the index cells, it was possible to access different elements of the array. We especially emphasize that the formation of the resulting address was carried out in the control unit at the time the command was executed, so the original command in RAM was saved without changes.

The described mechanism for modifying addresses significantly simplified the writing of cyclic programs, such as finding the sum of consecutive RAM cells, copying individual memory sections, etc.

In third-generation computers, the ideology of memory construction changed significantly: the minimum piece of information for exchange with RAM was set equal to 8 binary digits, i.e. one byte. It has become possible to process several types of data: text characters (1 byte), integers (2 bytes), real numbers of ordinary or double precision (4 or 8 bytes, respectively). In this regard, a new conventional unit of information measurement was introduced - the machine word. It was equal to 4 bytes and corresponded to the length of a standard real number. All amounts of information began to be measured in units that are multiples of a word: double word, half word, etc. Naturally, the address (RAM cell number) in machines with a byte organization began to refer to a separate byte; memory bytes have numbers increasing by one. A word consists of several sequential bytes. As the address of a word, it is convenient to take the address of one of the bytes that form it (usually the low byte, which has the smallest number, is used). Thus, the addresses of words no longer change after one; their increment depends on the length of the machine word in bytes and is equal to four.

The size of the machine word was apparently chosen based on the formats of the information being processed, and not in connection with the bit capacity of any devices. To confirm this, here are a few facts about typical third-generation computers from the EC family. The arithmetic-logical unit of the EC-1022 model had 16 binary bits, the EC-1033 had 32 bits, and the EC-1050 had 64 bits. At the same time, for one access to RAM in the ES-1022 and ES-1033, 4 bytes were selected, in the ES-1050 - 8 bytes (and in the ES-1045 - 16 bytes). Thus, the variety of numbers indicates that 32 bits (4 bytes) were not some technically allocated amount of information.

In third-generation machines, several more features appeared: different lengths of instructions depending on the method of addressing data, the presence of a special ultra-random register memory, calculation of the effective RAM address as the sum of several registers, etc. All this was further developed in fourth-generation computers, for which the microprocessor capacity became one of the most important characteristics. We will postpone consideration of the structural features of fourth-generation computer memory until the next section.

Control questions

1. What is computer architecture? Formulate a definition and decipher it.

2. Draw an analogy between computer architecture and the ordinary concept of architecture. What are the similarities and what are the differences?

3. What is common and what is the difference between the concepts of “internal structure of a computer”

and “computer architecture”?

4. What is a computer family? Give examples.

5. Explain the principle of software compatibility. What is bottom-up compatibility (explain with the example of one of the families you know)?

6. Are the following facts related to the concept of “architecture”:

a) does the computer use dynamic (or static) RAM chips?

b) does the computer have extended memory?

c) does the computer have (does not have) a common bus through which information is transferred between its devices?

d) in the INTEL 80386 processor, several new ones have been added to the instruction system compared to the INTEL 80286?

e) the memory capacity of the new computer model has been doubled?

7. List the basic principles of von Neumann architecture and explain their content.

8. What is the reason for the widespread use of the binary system in computers?

9. Is it possible? by looking at the contents of a single memory cell, determine what information is written in it: number, command, symbols?

10. What are the main components of a computer?

11. What is a program counter and what role does it play?

12. What is a highway (bus)?

13. What advantages does the mainframe computer structure have?

14. What is an external device controller and what role does it play in the information exchange process?

15. What role does video memory play in a computer?

a) text mode (24 lines of 80 characters);

b) graphic black and white mode with a screen size of 640x200 pixels;

c) 16-color mode with the same screen size.

17. What is DMA mode?

18 What is the name of the elementary component of a machine command? What can determine the speed of command execution?

19. Describe the main stages of executing a machine command. Special attention

pay attention to the role of the program counter.

20. What is command pipelining and what advantages does it have?

21. What basic operations are part of the command system of any computer?

Briefly describe each of these groups.

22. Explain why it is possible to create a computer with reduced (incomplete)

a set of commands and what it gives.

23. What parts does a computer team consist of? Briefly describe their purpose.

24. What is the difference between one-, two- and three-address commands?

25. What is a RAM address?

26. How can you use the same command to work with several

sequentially arranged cells?

27. Indicate the differences in the memory structure of a third-generation computer compared to the previous two.

Alexander Savvateev

General information

The M-3 computer was developed under the leadership of I. S. Brook. It belongs to the class of small universal machines.

The machine performs operations on 31-bit fixed-point numbers at a rate of 30 biaddress operations per second. The RAM is implemented on a magnetic drum and has a capacity of 2048 numbers. If memory on magnetic cores is connected to a computer, performance increases to 1500 operations per second.

The M-3 does not have external memory devices.

Punched tape and teletype are used for input and output of information.

The machine has 770 vacuum tubes and 3000 semiconductor diodes and consumes 10 kW of electricity. To accommodate it, 30-40 m2 is enough.

Memory and information structure

The RAM of the M-3 computer has a capacity of 2048 31-bit numbers or commands. All memory cells are equal to each other. To access memory cells, 11-bit addresses are used. The bits of memory cells are numbered from left to right; The most significant (leftmost) digit is number 0.

Binary fixed-point numbers contain the sign of the number in the zeroth digit, and the remaining 30 digits are occupied by the absolute value of the number. Thus, M-3 uses direct rather than two's complement code to represent negative numbers. It is generally accepted that the integer part of a number is equal to zero, and digits 1-30 contain its fractional part.

Decimal numbers also have a zero integer part. Their sign is placed in the zero digit, and in digits 1-28 there are seven notebooks encoding the decimal digits of the fractional part of the number. Bits 29-30 are not used.

Information input/output

Punched tape is used to enter the program into the computer memory. For each cell on the punched tape, its address, the end-of-address sign, the value of this cell and the end-of-value sign are printed. At the end of the program a special sign appears. The program is entered by pressing the corresponding button on the computer control panel.

Punched paper tape is also used to enter data, but it contains a continuous array of decimal numbers without any additional codes. Their input is provided by the program using a special command.

Information is output to a printing device such as a teletype.

Command system

The M-3 computer is a two-address machine. Each command occupies one memory cell. Command code bit 0 is not used, bits 1-6 contain the operation code, bits 7-18 are the address of the first operand, bits 19-30 are the address of the second operand and the result.

The arithmetic device of the M-3 computer has an adder into which the result of the last performed operation is entered. The contents of the adder can be used in the next operation.

When a negative result is received, including a negative zero, the sign w = 1 is formed. When a positive result is obtained, the sign w = 0.

All commands can be divided into two groups: arithmetic-logical and control commands.

The arithmetic-logical instruction code has the form xy, Where x- operation modifier (one octal digit); y- operation code (second octal digit). Possible values ​​of codes and modifiers of arithmetic-logical operations are given in the following tables. 1-2.

Table 1

table 2

In table 1 a And b mean the memory cells specified by the first and second addresses in the instruction code, respectively; r- adder register.

Control commands have no modifications, so their code always takes two octal digits. The list of control commands is given in table. 3.

Table 3

Operation code Team name Actions performed on command
07
27
Entering numbers from punched tape One number from the punched tape is entered into the cell b. It is not entered into the adder. Cell address a is zero
05
15
Carrying a number Number from cell a is transferred to the cell b
45
55
Transferring numbers and printing Number from cell a is transferred to the cell b and simultaneously printed on a teletype
24 Unconditional jump to first address a
b
64 Unconditional jump to first address and print Control is transferred to the cell with the address a
and at the same time the contents of the adder are written to the cell with the address b and printed on a teletype
74 Unconditional jump to the second address Control is transferred to the command with the address b. Address a in the command code is zero. The sign bit of the adder is cleared, i.e. the absolute value of its original value remains in the adder
34 Conditional jump If w =1, control is transferred to the cell with the address a, and if w =0 - to the cell with the address b
37 Stop The car stops. The control panel is issued a. The contents of the adder do not change. Address field b in the command code is equal to zero

Lecture 11 BASIC COMPUTER COMMANDS Classification of commands according to various criteria Structure of computer commands Data transfer commands Data processing commands Control transfer commands Commands for working with subroutines. Stacks. Other computer commands.

Computer command system All the variety of problems solved on a computer is implemented using a small set of very simple commands. The command system of a typical computer includes only 60-150 basic commands. All commands are mainly used to perform very simple actions, such as read, remember, add, move, compare, etc. The intelligence of the computer is achieved due to the fact that the computer is capable of executing programs consisting of a large number of such simple actions with a huge , a speed not achievable for humans. When describing a computer command system, it is usually customary to classify commands according to the following criteria.

Classification of computer commands By functional purpose Data transfer commands Data processing commands Control transfer commands Additional (other) By number of addresses Null-address or addressless With one address With two addresses With three addresses By method of encoding the operation By length With a fixed length of the operation code With a variable length of the operation code By addressing method One byte (word) Two bytes (words) Three bytes (words)

Operation code a 1 a 2 a 3 - Three-address command a 1, a 2 – addresses of cells (registers) where the numbers involved in the operation (operands) are located and 3 – address of the RAM cell where the result should be placed Operation code a 1 a 2 - Two-address command The result is written to cell a 2 Operation code a 1 - Uniaddress command a 1 – address of the cell where the number involved in the operation is stored or the address of the cell where the result is written Operation code - Zero address command All operands in the CPU register

Data transfer commands This group of commands includes subgroups of commands for transferring codes between registers inside the processor, from processor registers to memory, from memory to processor registers, from one memory cell to another, and data transfer between the processor and external device ports. A separate subgroup consists of teams for working with the stack. They allow you to put data on a stack for temporary storage and to pop data from the stack when you need to use it.

Data processing commands This group of commands, in terms of operations performed on data, can be divided into arithmetic (add, subtract, multiply, compare), logical (AND, OR, NOT operations, etc.) and shift commands. Instructions of this type can have one or two operands. Operands can be stored in CPU registers, in memory, or in the instruction itself.

The result of the operation is formed in the receiving register or in a specialized accumulator register. The commands of this group also form result signs that are set in the processor flags register: transfer from the most significant bit, overflow, zero result, etc.

Learn more about the compare command Typically, the processor performs a subtraction operation to compare two numbers. Based on the result of the subtraction, the flags in the flag register are set. Obviously, if the numbers being compared are equal, the result of the subtraction will be zero and the zero result flag will be set in the register. If the first of the compared numbers is greater, the result of the subtraction will be negative and the negative result flag will be set. The result of the subtraction is not stored in memory, since the state of the flag register can be used to judge the results of comparing numbers.

Control transfer commands They are important because they are used to change the natural order of commands and organize cyclic sections in programs. The simplest control transfer instruction is the JMP unconditional jump instruction, which loads the jump address specified in the instruction into the program counter. Conditional jump instructions test the condition specified in the command and modify the program counter if the condition is true.

Src="http://present5.com/presentation/3/-29919247_13569617.pdf-img/-29919247_13569617.pdf-11.jpg" alt="Example of a conditional jump command IF statement (A>B) then go to L of some language"> Пример команды условного перехода Оператор IF (A>B) then go to L некоторого языка высокого уровня может быть реализован двумя командами ЭВМ: СРАВНИТЬ А и В ПЕРЕЙТИ ЕСЛИ БОЛЬШЕ К АДРЕСУ L Если А>В, то результат вычитания будет положителен и соответственно флаг знака во флаговом регистре не установится. Вторая команда (условный переход) проверяет состояние флага знака и, если он не установлен, модифицирует программный счетчик так, чтобы его значение указывало на адрес L.!}

Organization of subroutines In programming, a technique called organization of subroutines is widely used. A subroutine is described once, but can be called repeatedly from different places in the program. A subroutine can call another while it is running. After the subroutine has completed its work, control must be transferred to the command next in memory immediately after the command to access this subroutine. The address of the command to which control is transferred after the completion of the subroutine is called the return address.

Where should I store my return address? In order to start executing a subroutine, the program counter must be loaded with the address of the first instruction of the subroutine. To return from a subroutine, you must remember the return address somewhere. You can, for example, store the return address in one of the processor registers. This method of storing the return address is very simple and easy to implement. However, it is common to find subroutines that call other subroutines. Let the main program call subroutine A. It in turn called subroutine B. If the return address for subroutine A is stored in a processor register, then where should the return address be placed when calling subroutine B?

Generalized algorithm for the operation of a von Neumann computer Initialization Fetching a command Incrementing the program counter Decryption and execution of a command No Command “Stop the processor” Yes Initialization

The Concept of a Stack Most computers use a hardware-supported data structure called a stack. A stack is a data structure organized according to the last-in, first-out principle, i.e., the last data written to the stack is the first to be retrieved from it. Translated from English. stack - stack. An analogue of a stack can be a stack of plates. You can put a plate in a stack only from the top; again, you can remove only the top plate without any problems.

Stack organization 1. In a computer, an area of ​​RAM is allocated to organize the stack, and a stack pointer register is used to address it and access the stack. 2. The stack pointer register stores the address of the memory cell containing the last value pushed onto the stack. 3. When a number is written to the stack, the stack pointer is modified to point to the next free location and the data is written to it.

4. When popping from the stack, data is read from the OP cell pointed to by the pointer, then the stack pointer is modified to point to the penultimate value stored on the stack. 5. Typically, stacks grow in the direction of decreasing addresses, i.e., when writing a number, the stack pointer decreases, and when popping a number from the stack, it increases.

Commands for working with subroutines. Stacks Stack = OP cells + register - stack pointer (CPU ALU) Register - stack pointer stores the address of the OP cell, which contains the last return address placed on the stack Stack data structure using example A) Initial state: empty stack OP cells Cell addresses 1000 Pointer stack 998 996 B) Two return addresses are written to the stack: 1234 and 5678 1234 1000 Stack pointer 5678 998 Writing return addresses 996 C) One address is popped from the stack, the last Stack pointer 1234 1000 998 996 Reading 1000

Src="http://site/presentation/3/-29919247_13569617.pdf-img/-29919247_13569617.pdf-19.jpg" alt="Operation of the CALL subroutine call command 1. When the processor reads the CALL command from memory"> Работа команды вызова подпрограмм САLL 1. Когда процессор считывает из памяти команду САLL , программный счетчик увеличивается и показывает на команду, следующую за командой САLL. То есть программный счетчик теперь содержит адрес возврата, с которого должно продолжиться выполнение основной программы после окончания работы подпрограммы. 2. При выполнении обращения к подпрограмме процессор сохраняет содержимое программного счетчика в стеке, точнее, в его ячейках ОП. 3. Далее в программный счетчик загружается адрес команды, с которого начинается подпрограмма. Процессор приступает к выполнению подпрограммы.!}

Operation of the RETURN command 1. To return from a subroutine to the main program, use the RETURN commands. 2. The return instruction from the subroutine pops the return address stored on the stack from the stack and places it in the program counter. 3. The processor begins executing the main program. 4. If there were several nested calls to subroutines, then the return will occur at the return address saved by the last call (since the stack is used to store return addresses and the last saved return address will be called first).

Other computer commands There may be additional (special) commands in a computer. These include commands to stop the central processor, reset external devices, install or reset individual features, etc. So, in this lecture, the basic commands used in typical computers and the actions implemented by these commands were briefly discussed.