smoαcell ::= (simplesmo)|(simplesmo+integer)|(simplesmo+modifier)| (simplesmo+modifier+integer)| αidentifier(simplesmo)| αidentifier(simplesmo+integer)|αidentifier(simplesmo+modifier)| αidentifier(simplesmo+modifier+integer) {a=x|r} (but see Section 26.4) simplesmo ::= simpleαcell|£upperidentifier|blockidentifier
This section describes the more complex formats for accessing the contents of storage cells. The syntax above defines an address of a storage location. The assignment statements defined earlier either deposit a new value into this location or access its contents. Unlike the simpleαcell designators, it is necessary to generate more than one instruction for each appearance of a smoαcell in a statement. On some 1900 computers (including a 1906A) there is a special SMO hardware instruction which causes the next instruction obeyed to have its address modified by the contents of the word specified in the SMO instruction. On these computers it is therefore reasonably efficient to use SMO designators. On other computers in the 1900 range, a macro instruction has to be obeyed which is equivalent to between 3 and 5 instructions. It is recommended that SMO cell designation should only be used when the same effect cannot be produced using simple cell designators.
The three different forms of the SIMPLESMO define a value as follows:
If the value defined by the simplesmo is V, the value of the integer defined in the syntax is I, the contents of the modifier is X, and the displacement of the identifier is $ then the address specified in each case is:
(simplesmo) V (simplesmo + integer) V+I (simplesmo + modifier) V+X (simplesmo + modifier + integer) V+X+I αidentifier (simplesmo) $+V αidentifier (simplesrno + integer) $+V+I αidentifier (simplesmo + modifier) $+V+X αidentifier (simplesmo + modifier + integer) $+V+X+I
The addresses calculated must have 0 ≤ $-I, I, $+I < 4096
Consider the declarations:
LOWER INTEGER LAA=@LB, LE=1, LC=@UA; LOWEND; BASE; INTEGER UA=3, UB=@UA, UC=11; GLOBAL FRED: INTEGER D=5,E=9; GLOBEND;
Then the following integer assignments statements produce the result given:
(a) X2 := (LAA); sets X2 to 1, the contents of @LB (b) X2 := (LAA(2)) sets X2 to 3, the contents of @UA (c) X1 := @LAA; X2 := ((X1)); sets X2 to 1 (d) X3 := 2; X2 := (LAA(X3)); sets X2 to 3 (e) X3 := £UB; X2 := (UB(X3)) sets X2 to 3 (f) X3 := 1; X2 := (LAA(X3-1)); sets X2 to 1 (g) X3 := 1; X2 := (LAA(X3+1)+2); sets X2 to 11 (h) X2 := LAA(LAA(1)+1); sets X2 to GUA (i) X2 := E(FRED) sets X2 to 9 (j) X2 := UA(£UA) sets X2 to 3
As the integer accumulators can also be accessed as the first 8 locations of store, it is possible to use integer accumulators other than X1, X2 and X3 as modifiers by specifying their store addresses. For example, X6 can be referred to as (6) so that in the same way X3 can be used as a modifier in U(X3), X6 can be used in U((6)). Double modification can be achieved by using designators of form ((6)+X2). To use an index consisting of contents of X1 and X2, the designators ((1)+X2) or ((2)+X1) can be used.
There are currently two errors in the PLASYD compiler involving SMO designators. Using the alternatives given below:
smoαcell ::= (simplesmo) simplesmo ::= simplexcell simplexcell ::= lowerαidentifier (-integer)
it should be possible to write statements of the form:
X2 := (LC(-2));
Statements of this type currently give a compiler error and generate incorrect code.
Similarly:
smoαcell ::= (simplesmo + integer) simplesmo ::= simplexcell simplexcell ::= αidentifier (modifier - integer)
should allow a statement of the form:
X2 := (LAA(X3-1)+1;
This also generates incorrect code and gives a compiler error.
Apart from these two cases, the correct code is generated for the syntax given at the head of the chapter.