• Keine Ergebnisse gefunden

DISCUSSION OF OPERANDS

Im Dokument The Computer Concepts (Seite 123-129)

P AND Q OPERANDS

The operands that will be assembled as the P and Q portion of an

2 See pages 105 and 106 for a discussion of symbolic, absolute, and asterisk addresses.

The Symbolic Programming System 105 instruction are of three types: actual (synonymously termed absolute), symbolic, and asterisk.

ACTUAL

An actual address consists of five or fewer digits and is the actual 1620 core storage address of a piece of data or an instruction. High-order zeros of an actual address may be eliminated. See Figure 11.2 for an example of instructions where both P and Q addresses are absolute.

LlN£ LABH OP£RAlION OP£RANOS I R£MARAS

The above program has no purpose other than demonstration of actual address assignment.

Note that the processor fills in high-order positions of P and Q addresses with zeros if less than 5 digits should be present. Some programmers enjoy the uniformity of always utilizing 5-digit fields whether or not they are required.

SYMBOLIC

The symbolic address is a name or label assigned by the programmer to a piece of data or an instruction. Such a symbolic address is valid if and only if it appears somewhere in the source program in the Label field.

Either one or both of the P and Q operands may be symbolic. See Figure 11.3 for an example of symbolic addresses.

106 The Symbolic Programming System

Fig. 11.3. Symbolic Addressing.

Figure n.S-Commentary

Also, assume that the location counter stands at 800 when these instructions are encountered by the processor. The following instructions are generated:

(00800)

Of course, this example assumes that at some point in the program all symbols employed were properly defined by appearing in a label field of an instruction or declarative.

ASTERISK

The character, asterisk (*), when used as an operand in the P and/or Q portions of an instruction, makes reference to the present value of the location counter. (The location counter is the true correspondent to the origin counter discussed in the previous chapter.) This is equivalent to the address of the 00 (high-order-Ieft-hand) position of the instruction which contains the asterisk. See Figure 11.4 for an example of asterisk addresses. The asterisk rule is somewhat different in the case of a declarative. Be sure to note it.

The Symbolic Programming System 107

LINE

.

LABEL '" OFfRATlDN , , OPERANDS I REMARKS ,.

. B,NF F,I,N,I,S.H, • B,

.,

.

Fig. 11.4. Asterisk Addressing.

Figure 1l.4-Commentary

Assume that location "Finish" is synonymous with core location 15000 and that the location counter stands at 900 when these instructions are encountered by the assembly system. The following instructions are therefore generated:

(00900) (00912)

44 15000 00900 49 00912 00000

The latter instruction is a classic example of how not to use a computer. A never-ending branch has been developed with no way out.

FLAG OPERANDS

A Hag is placed in those positions of the assembled instruction specified by the Hag operand. In the event that an instruction is of the Immediate type, a Hag is automatically placed over the Q7 digit of the assembled instruction. However, the presence of the Hag operand takes precedence.

Thus, a Hag operand of 8 causes a Hag to be set in Qs and not in Q7' If more than one Hag is desired in an assembled instruction, the Hag operand must indicate all positions to be flagged. Thus, if a flag is desired in Q7 and Qll, the Hag operand reads "711." The order of ele-ments in the flag operand is quite critical here. If one wishes a Hag at posi-tion 00 and 01, the Hag operand is written as "01" and not as "10." This latter configuration would cause a Hag to be placed at position

QlO'

If one desires every digit of an assembled instruction to be Hagged, the Hag operand would read "01234567891011."

There is one exception to the rule governing the use of an Immediate instruction without a flag operand: the instruction Transmit Digit Imme-diate will assemble with no Hag placed on the assembled instruction unless specifically told otherwise through the use of the Hag operand.

See Figure 11.5 for examples of the Hag operand in use.

Any instruction may have a flag operand but its use is most effective in the Immediate type.

108 The Symbolic Programming System

LINE LABEL OPERATION OPERANOS & REMARKS

,

.

II I t IS 16 o , " " " by the processor. The following instructions are generated:

11 12027 12057 presence of the remark did not affect the assembly or generate any coding.

The Symbolic Programming System 109 ADDRESS ARITHMETIC

Any P and/or Q address, symbolic, asterisk, or actual, may be incre-mented (

+ ),

decremented ( - ), or multiplied (*) by a numeric constant or a symbol representing a numeric quantity.s By utilizing a variety of address arithmetic, any P and/or Q address may assume any variation of the following form:

where A, B, C, and D are numeric, asterisk, or symbolic, and multiplica-tion is of prime order.

Symbolic instructions of the form:

RNCD B TF AM are permissible.

INPUT-79 START+24

LOC*16,DATA +5*L-CONST

*+23,5,10

Figure 11.6 contains extensive examples of address arithmetic.

Equivalent After P or Q Operands Assembly

START + 40, 04040

Symbols ALPHA - 30, 00970

Used In START + 2 *L, 04024

Operands Equivalent START * 3, 12000

ALPHA * 5 + 40, 05040

ALPHA 1000 4 * 13+ OUTPUT, 15052

START 4000 START + 4 *L - 1, 04047

L 12 ALPHA *L, 12000

ORIGIN 600 SOO + 3) * 3 - 11, 00549

OUTPUT 15000 OUTPUT - L * ALPHA + ORIGIN 03600

Fig. 11.6. Samples af Address Arithmetic.

3 Note this alternate function of the asterisk symbol. In all, there are four separate and distinct uses for asterisk of which two have been discussed: (1) an instruction operand and (2) a symbol implying multiplication.

110 The Symbolic Programming System

Im Dokument The Computer Concepts (Seite 123-129)