|
|
|
|
|
|
Figure 3.6
Overlapping character strings. If A is to be moved to B
(starting within A), then the overlap must be detected lest
the overlapped portion of the two be stored into before it is
accessed. |
|
|
|
|
|
|
|
|
with the bytes of a second operand (length is assumed to be the same as first operand). The comparison is logical (no sign recognized), and a condition code is set after execution. |
|
|
|
|
|
|
|
|
The Move Characters (MOVE.C)also MMcopies data from the second operand into the first operand using the length specified by the instruction. |
|
|
|
|
|
|
|
|
Character Manipulation Instructions This group of instructions specifies a source and destination starting location for a character string and a length in the range 1256. One of the characteristics of these instructions that makes their implementation very difficult is that overlapped operands may occur and must be treated a byte at a time (Figure 3.6). This allows, for example, a single byte to be propagated throughout a string by a move instruction whose destination address is one greater than the source address, since the fields are processed left to right. |
|
|
|
|
|
|
|
|
Peuto and Shustek [231] report that in two of the programs (a PL/1 compilation and a Cobol compilation) the nonoverlapped case occurred about 50 times more frequently than the overlapped case. However, the average number of bytes moved was less than 8 for the nonoverlapped move and greater than 50 for the overlapped move. |
|
|
|
|
|
|
|
|
There are also instructions in this class for which the number of bytes processed may be much smaller than indicated in the instruction, such as CMP.C For these instructions, the distribution of the length specified in the instructions is a poor indicator of the length actually used. Peuto cites a typical example from one of his programs (a Cobol compilation), when the average CMP.C instruction specifies 4.53 bytes, but an average of only 1.744 bytes is examined by the hardware. |
|
|
|
|
|
|
|
|
Table 3.21 indicates operand length from the character manipulation instructions. |
|
|
|
|
|
|
|
|
The MOVE.C has a frequency of about 9% for this mixwith almost all of these being for unoverlapped operands. For two-thirds of the instructions, the operand length is eight or fewer bytes. However, most of the data moved by MOVE.C instructions is done with large operand lengths. Thus, the designer faces the dilemma of providing rapid execution of the more frequently occurring short operand MOVE.C instructions without slowing down the MOVE.C instructions that move the bulk of the character-oriented data. |
|
|
|
|
|
|
|
|
Decimal Arithmetic Instructions This group of instructions specifies two operands of length 1 to 16 bytes that either do not overlap or have co- |
|
|
|
|
|