Condition code.
Conditional transfer of control command contains the address of the team to carry out which should go FF, if a certain condition, for example if I have the internal state corresponds to an appropriate value.
In two-address instruction addresses the operation result (A3) and the command of the program (A4) contains the implicit: A3 = A2 and A4 is defined by the counter.
Way to further reduce the address of the command - placing in memory the result of a team in place of one of the operands, usually the second. As a result, the team of CA can be made two-address.
The process of executing two-address instruction by the example of. Let the set of symbols, which operates the CA, includes decimal numbers, and we care about the team adding numbers 3 and 2, located in RAM at addresses A1 and A2 = 7 = 9. This command may be coded symbols 7, 9. Assume that each cell of RAM is designed for storing a single character, and character is in the second cell. Then, prior to executing the contents of IC should be equal to 2. To access the operands for the command uses the address W (CA), which provides treatment to the cells of their memory addresses.
An even greater reduction in the address part of instruction allows the use of so-called scratchpad memory (SPM) - a small number of high-speed memory elements, combined in the registers, the device which will be explained in Chapter 6. Benefits of registered memory due to the fact that the current team often uses the program as one or even two operands results immediately prior to her commands. If they are entered in the SRAM, the address of the teams will not take up much space, so to. SRAM address register by a small number of them very short. This addressing method is called the register operands. If instead of the operands in the SRAM to store the addresses A1 and A2, then there is the possibility of access to operands of RAM. Address of instruction is not increased, since it is not called themselves the A1 and A2 and the short address registers. This is called indirect addressing register. With the use of SRAM registers can develop other methods of addressing why they are called general purpose registers (GPR).
Most modern computers designed to work with two-address instruction and extensive use of RON. As a particular case may be unicast command (for example, transfer of control) and no address instruction not accessing memory.
In principle it is possible to build the CA, using only the zero address the team, i.e. command without explicitly specifying any of the operands. This possibility is based on the representation of algorithms in the form of so-called bracket-free or inversion of the Polish records (POLIZ). In this organization is extremely convenient storage for storing the operands on the principle "last in - first out" or LIFO (from the English. Last In-First Out). Memory, using this principle, called the stack: it stores the characters in the order they are received, and the issue of the return.
Stack calculations are widely used in calculators. |