User manual

651
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
Matrix_Subtract
Prototype
procedure Matrix_Subtract(var src1, src2, dest: array[1024] of word; numRows,
numCols: word);
Description Function does matrix subtraction.
dstM[i][j] = srcM1[i][j] - srcM2[i][j]
Parameters - src1: rst matrix
- src2: second matrix
- dest: result matrix
- numRows: number of rows in the source matrix
- numCols: number of cols in the source matrix
Returns Nothing.
Requires Nothing.
Example
var
mx1 : array[6] of word;
mx2 : array[6] of word;
mxDest : array[9] of word;
...
Matrix_Subtract(mx1, mx2, mxDest, 2, 3);
Notes - [W0..W4] used, not restored
- AccuA used, not restored
- AccuB used, not restored
- CORCON saved, used, restored
Matrix_Scale
Prototype
procedure Matrix_Scale(ScaleValue: word; var src1, dest: array[1024] of
word; numRows, numCols: word);
Description Function does matrix scale.
dstM[i][j] = sclVal * srcM[i][j]
Parameters - ScaleValue: scale value
- src1: original matrix
- dest: result matrix
- numRows: number of rows in the source matrix
- numCols: number of cols in the source matrix
Returns Nothing.
Requires Nothing.
Example
var
mx1 : array[6] of word;
mxDest : array[9] of word;
Matrix_Scale(0x4000, mx1, mxDest, 2,3);
Notes - [W0..W5] used, not restored
- AccuA used, not restored
- CORCON saved, used, restored
- numRows*numCols < 2
14