11: BINARY ARITHMETIC INSTRUCTIONS
11-4 « FC4A MICROSMART USER’S MANUAL »
Repeat Operation in the ADD and SUB Instructions
Source operands S1 and S2 and destination operand D1 can be designated to repeat individually or in combination. When
destination operand D1 is not designated to repeat, the final result is set to destination operand D1. When repeat is desig-
nated, consecutive operands as many as the repeat cycles starting with the designated operand are used.
Since the repeat operation works similarly on the ADD (addition) and SUB (subtraction) instructions of the word and inte-
ger data types, the following examples are described using the ADD instruction of the word data type.
Repeat One Source Operand
When only S1 (source) is designated to repeat, the final result is set to destination operand D1.
Repeat Destination Operand Only
When only D1 (destination) is designated to repeat, the same result is set to 3 operands starting with D1.
Repeat Two Source Operands
When S1 and S2 (source) are designated to repeat, the final result is set to destination operand D1.
Repeat Source and Destination Operands
When S1 (source) and D1 (destination) are designated to repeat, different results are set to 3 operands starting with D1.
Repeat All Source and Destination Operands
When all operands are designated to repeat, different results are set to 3 operands starting with D1.
Note: Special internal relay M8003 (carry/borrow) is turned on when a carr y or borrow occurs in the last repeat operation.
When a user program execution error occurs in any repeat operation, special internal relay M8004 (user program execution
error) and the ERR LED are turned on and maintained while operation for other instructions is continued.