Try this (from memory, untested):
Function Mul(Const mat1,mat2:Matrix):Matrix;
Var
i,j,k:Word;
sum:Extended;
u,v:PExtended;
mat:Matrix;
rowstride:integer;
Begin
// check for smaller matrix here, must have at least 2 rows.
rowstride:=ptrint(@mat[1,0])-ptrint(@mat[0,0])
For i:=0 to n-1 do
For j:=0 to n-1 do
Begin
sum:=0;u:=@mat1[i];v:=@mat[i,j];
For k:=0 to n-1 do
Begin
sum+=u^*v^;
Inc(u);Inc(pbyte(v),rowstride);
End;
Mul[i,j]:=sum;
End;
End;