• Keine Ergebnisse gefunden

Basic Programming Concepts

Im Dokument The Computer Concepts (Seite 41-45)

Contrary to some popular belief, the digital computer is not a "brain."

It does not yet possess the intelligence to think. The computer can do nothing of its own volition, but must rely upon instructions supplied by humans to perform a given task. Thus a communication between man and computer is necessary. This communication takes the form of a set of formal instructions with which we command the computer and to which the computer responds. Once the computer has received its instructions, it can perform its task at speeds measured in microseconds.

The combination of the human thought process and the fantastic speeds at which computers operate form a powerful tool for industry and re-search.

Chapters 5 through 9 are devoted to a complete detailed description of all basic 1620 instructions. These instructions fall into five general categories:

1. Arithmetic

2. Internal Data Transmission 3. Branch

4. Input-Output 5. Miscellaneous

The 1620 digital computer utilizes a 12-digit instruction which is divided into three parts: a 2-digit operation (OP) code, a 5-digit P address (P Operand), and a 5-digit Q address (Q Operand). Each of the 12 digits making up an instruction is assigned a unique notation so that easy

22

Basic Programming Concepts 23 reference may be made to any part of an instruction. The two digits forming the operation code will be referenced as 00 and 01 , The five digits comprising the P address will be referenced as P2 , Pa, P4 , P5, and P6 • Similarly, the five digits comprising the Q address will be referenced as Q7, Qs, Q9, QI0, and Qll'

Fig. 3.1 illustrates the format of a 1620 instruction.

00

J

01 P21 Pa

I

P4

I

P5

I

P6 Q7

I

Qs

I

Q9

I

QlO

I

Qll

OP P Address Q Address

Code

Fig. 3.1. Instruction Format.

The 2-digit operation code specifies which operation is to be executed.

Table 3-1 is a chart of all basic 1620 operation codes and their associated mnemonics. Mnemonics refer to the alphabetic representation of opera-tions codes used in the symbolic programming system (see Chapter 11).

The 5-digit P operand has many functions, depending on the instruc-tion. It may represent the core location (1) that data is transmitted to,

( 2) that data is transmitted from, (3) that the program branches to, or ( 4) of data to be processed.

Likewise, the

Q

operand has many functions, depending on the instruction. It may represent (1) the address from which data is trans-mitted, (2) the input-output device that is employed, (3) the address of data to be processed, or (4) the indicator that is interrogated.

The 1620 has an extremely powerful and flexible instruction repertoire.

Certain arithmetic and internal data transmission instructions are labeled immediate. These instructions use part of the instruction itself as a data field. The low-order position of the data field is the Qll position of the instruction itself. The immediate instructions greatly facilitate pro-gramming and conserve storage locations by storing constants as part of instructions.

The instructions that direct the 1620 are stored in the magnetic core memory of the computer. The high-order digit (00) of an instruction must be located in an even-numbered core position. This restriction is imposed by the workings of the internal circuitry of the computer, with which we will not concern ourselves at this time. Suffice it to say that this restriction is easily complied with.

An instruction is referenced by the core location of its high-order digit (00 ), Thus if we refer to the instruction at core location 00012, the instruction we are referencing is made up of the digits in core locations 00012 to 00023, inclusive.

24 Basic Programming Concepts

INTERNAL DATA TRANSMISSION INSTRUCTIONS

Transmit 'Digit TD 25

The 1620 uses a 2-address instruction system. During normal operation, program instructions are executed sequentially. For example, if we start at core location 00000, the instructions at 00000, 00012, 00024, 00036, and so forth, are executed in that order. This sequential execution of instructions can be altered by the use of the branch instructions discussed in Chapter 7.

Basic Programming Concepts 25 In a address system both addresses may reference data. The 2-address system is in contrast to a 1-over-1 2-addressing system, in which part of the instruction itself is used to indicate the location of the instruc-tion to be executed next. The 2-address system is, in many ways, a much more powerful and flexible programming system.

In the discussion of the functions of the Q address, it was mentioned that indicators may be interrogated. The 1620 has internal machine indi-cators to facilitate the decision-making ability of the computer. The three indicators of greatest importance are the following:

1. High Positive (HIP). The High Positive indicator is turned on if the result of an arithmetic operation is positive and not zero.

2. Equal/Zero (E/Z). The Equal Zero indicator is turned on if the result of an arithmetic operation is zero.

3. Overflow. The Overflow indicator is turned on if certain overflow conditions exist.

A more detailed discussion of the on-off status of the indicators is made in the chapter on arithmetic instructions.

As each instruction is discussed, a formula for computing execution time will be given. The following abbreviations are used.

Dp = Number of digits, including high-order zeros, in the field at the P address.

Dq

=

Number of digits, including high-order zeros, in the field at the Q address.

De

=

Number of positions compared prior to detection of a digit other than zero.'

Rq

=

Number of digits, including the record mark, in the record at the Q address.

Chapter 4

Im Dokument The Computer Concepts (Seite 41-45)