User manual

mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
646
Vector_Multiply
Prototype
procedure Vector_Multiply(var v1, v2, dest: array[1024] of word; numElems:
word);
Description This function does multiplication of two vectors.
dstV[n] = srcV1[n] * srcV2[n], n є [0, numElems-1]
Parameters - numElems: number elements in vector(s) (must be less or equal to minimum size of two vectors)
- v1: rst vector
- v2: second vector
- dest: result vector
Returns Nothing.
Requires Nothing.
Example
var vec1 : array[3] of word;
vec2 : array[3] of word;
vConDest : array [10] of word;
Vector_Multiply(vec1, vConDest, vec2, 3);
Notes - [W0..W5] used, not restored
- AccuA used, not restored
- CORCON saved, used, restored
Vector_Min
Prototype
function Vector_Min(var Vector: array[1024] of word; numElems: word; var
MinIndex: word): word;
Description This function nds minimal value in vector.
minVal = min (srcV[n]), n є [0, numElems-1]
If srcV[i] = srcV[j] = minVal, and i < j, then MinIndex = j.
Parameters - Vector: original vector
- numElems: number of elements in vector
- MinIndex: index of minimum value
Returns Minimum value (minVal).
Requires Nothing.
Example
var vec1 : array[3] of word;
index, rslt : word;
rslt = Vector_Min(vec1, 3, index);
Notes - [W0..W5] used, not restored