PURPOSE: To improve the processing speed of digit matching by dividing digit matching processing into two parts at the border of the number of matching digits n=4 and reducing the number of application times of multiplication and division instructions for digit matching when n≥4.
CONSTITUTION: Whether the number of matching digits in n<4 or not is checked. When n>4, n-4 is calculated and the multiplier 10,000 and the multiplicand are loaded to one register and the other in the same register respectively to multiply these loaded values. The multiplied result is evacuated temporally and added to the upper data. Said operation is repeated until the multiplication is repeated by the number of times of a half of the number by bytes corresponding to the defined number of digits. After completing said multiplication, the result is set in the register. When n-4 is "0", digit matching is ended and, when not "0", whether the differenceis <4 or not is checked. When the checked result is NO, said operation is repeated and, when Yes, whether the remaining number of digits is 1, 2 or 3 is checked. In case of 1, 2 and 3, each multiplier is defined as 10, 100 and 1,000, respectively and said multiplication is performed.