With this change the preceding program appears as

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: conditional or unconditional) for transfer of control to the address given in the operand field 4. Data movement operations for moving data between memory locations and registers 5. Data movement operations for moving data from or to one of the computer's input/output devices. Figure 12.1 shows atypical single-address machine language instruction. Although some computers are designed to use only single-address instructions, many computers are designed to use multiple-address instructions that include the addresses of two or more operands. For example, the augend and addend may be the two operands of an addition operation. OPCODE (operation code) OPERAND (Address/Location) Figure 12.1. Instruction format. We already know that all computers use binary digits (Os and Is) for performing internal operations. Hence most computers' machine language instructions consist of strings of binary numbers. For example, a typical program instruction to print out a number on the printer might be 101100111111010011101100 The program to add two numbers in memory and print the result might look something like the following: 001000000000001100111001 001100000000010000100001 011000000000011100101110 101000111111011100101110 000000000000000000000000 This is obviously not a very easy to use language, partly because it is difficult to read and understand and partly because it is written in a number system with which we are not familiar. But it will be surprising to note that some of the first programmers, who worked with the first few computers, actually wrote their programs in binary form as above. Since human programmers are more familiar with the decimal number system, most of them will prefer to write the computer instructions in decimal, and leave the input device to convert these to binary. In fact, without too much effort, a computer can be wired so that instead of using long strings of 1 s and 0s we can use the more familiar decimal numbers. With this change, the preceding program appears as follows: 10001471 14002041 30003456 50773456 00000000 This set of instructions, whether in binary or decimal, which can...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online