摘要 |
PURPOSE: To simplify a program by performing multiplication without a multiplication instruction word. CONSTITUTION: One character is taken into a register R4 from an input character string (S23), and it is discriminated whether this character is a numeric character of 0 to 9 or not by its character code (S24). When it is a numeric character of 0 to 9 (S24 Yes), the input character is converted to a decimal number (S25). The value in the register R4 converted to the decimal number is multiplied ten times to carry (S26). Since multiplier 10 is the sum of 2<1> and 2<3> at this time, the value obtained by left shifting contents of a register R2 of the multiplicand by the number of bits of power 1<1> of 2 and the value obtained by left shifting them by the number of bits of the power 3<3> of 2 are added to multiply the multiplicand by the multiplier. After the obtained value is checked (S27), the processing to take out the next character from the character string is started (S29). |