摘要 |
PURPOSE:To decrease the number of steps of a program and to attain high-speed processing by obtaining the maximum value of the array element and the maximum element number with a single instruction. CONSTITUTION:This method contains three steps. In the 1st step, the array elements are read out of a main memory according to an instruction word containing an operation code field, an inter-element distance designation field and an element number designation field. In the 2nd step, the maximum value among the elements counted up to the i-th place of the read-out array elements is stored in the 1st holding means and the corresponding element number is stored in the 2nd holding means respectively. The contentes of the 1st holding means are compared with the (i+1)th element. When the latter is larger than the former, the latter value is stored in the 1st holding means together with the corresponding element number stored in the 2nd holding means. In the 3rd step, the contents of the 1st holding means are stored in the 1st register with the contents of the 2nd holding means stored in the 2nd register respectively when the procedure is through with the n-th element.
|