Вот это, что ли? Тады H8/300H аврюшку уделает ;-) http://www.renesas.com/eng/products/mpumcu/16bit/tiny/application/index.html
Summation of Products (SEKIWA)
Finds the following sum of products for unsigned 16-bit data an and bn (n = 1, 2, …, n) in data tables a and b. The
maximum number of data elements, n, is 255.
Σanbn = a1*b1 + a2*b2 + … + an*bn ….. (1)
Target Device H8/300H Series
2 2;* *
3 3 ;* NAME : SEKIWA (SEKIWA) *
4 4 ;* *
5 5 ;***********************************************************
6 6 ;* *
7 7 ;* ENTRY: ER0 (TABLE ADDRESS) *
8 8 ;* ER1 (TABLE ADDRESS) *
9 9 ;* RETURN: R3H (HIGHER 8 BIT) *
10 10 ;* ER2 (LOWER 32 BIT) *
11 11 ;* *
12 12 ;***********************************************************
13 13 ;
14 14 .CPU 300HA
15 001000 15 .SECTION A,CODE,LOCATE=H'001000
16 00001000 16 SEKIWA .EQU $ ;
17 001000 18BB 17 SUB.B R3L,R3L ;
18 001002 1AA2 18 SUB.L ER2,ER2 ;CLEAR ER2
19 001004 6D0C 19 SEKIWA1 MOV.W @ER0+,E4 ;
20 001006 6D14 20 MOV.W @ER1+,R4 ;
21 001008 52C4 21 MULXU.W E4,ER4 ;
22 00100A 0AC2 22 ADD.L ER4,ER2 ;
23 00100C 9B00 23 ADDX.B #0,R3L ;
24 00100E 1A03 24 DEC.B R3H ;
25 001010 46F2 25 BNE SEKIWA1 ;
26 001012 5470 26 RTS ;
27 27 .END ;