
109
3.2 Functions
Chapter 3 Functions
Repeat MultiPle & Addition
Calculate sum-of-products
[ Description Example ]
RMPA
RMPA
[ Syntax ]
RMPA.size
B , W
[ Function ]
• This instruction performs sum-of-product calculations, with the multiplicand address indicated by A0, the multi-
plier address indicated by A1, and the count of operation indicated by R3. Calculations are performed including
the sign bits and the result is stored in R2R0 (R0)
*1
.
• If an overflow occurs during operation, the O flag is set to terminate the operation. R2R0 (R0)
*1
contains the result of the addition performed last. A0, A1 and R3 are indeterminate.
• The content of the A0 or A1 when the instruction is completed indicates the next address of the last-
read data.
• If an interrupt request is received during instruction execution, the interrupt is acknowledged after a sum-of-
product addition is completed (i.e., after the content of R3 is decremented by 1).
• Make sure that R2R0 (R0)
*1
has the initial value set.
Shown in ( )
*1
applies when (.B) is selected for the size specifier (.size).
RMPA.B
[ Operation ]
*1
Repeat
R2R0(R0)
*2
R2R0(R0)
*2
+ M(A0) M(A1)
A0
A0 + 2 (1)
*2
A1
A1 + 2 (1)
*2
R3
R3 – 1
Until
R3 = 0
*1
If you set a value 0 in R3, this instruction is ingored.
*2
Shown in ( )
*2
applies when (.B) is selected for the size specifier (.size).
Conditions
O :
The flag is set when +2147483647 (.W) or –2147483648 (.W), or +32767 (.B) or –32768 (.B) is
exceeded during operation; otherwise cleared.
U
I
O
B
S
Z
D
C
Flag
[ Instruction Code/Number of Cycles ]
Page=218
[ Fl ag Change ]
Change
Summary of Contents for R8C/Tiny Series
Page 50: ...Chapter 3 Functions 3 1 Guide to This Chapter 3 2 Functions...
Page 151: ...134 Chapter 3 Functions 3 2 Functions Blank for page layout...
Page 278: ...Chapter 6 Calculation Number of Cycles 6 1 Instruction queue buffer...
Page 297: ...R8C Tiny Series Software Manual 2 6 2 Ote machi Chiyoda ku Tokyo 100 0004 Japan...