Ассемблерная вставка в Delphi не работает
На данной картинке процедура умножения матрицы на число, только на второй итерации при mov eax,[ecx ] вываливается с ошибкой, в чем может быть дело?
Program assembler;
{ The program calculates the given matrix expression. }
{$APPTYPE CONSOLE} // Console application
// Modules declaration
uses
System.SysUtils;
// Type declaration
Type
TMas = array [1 .. 3] of array [1 .. 3] of integer;
// Declaring variables
Var
A: TMas = ((1, 0, 3), (-2, 0, 1), (-1, 3, 1));
B: TMas = ((7, 5, 2), (0, 1, 2), (-3, -1, -1));
check: boolean;
temp1Proc, temp2Proc, temp3Proc, temp4Proc: TMas;
k: integer;
{ A,B - Matrices specified by the condition of the problem;
check - Flag for setting the multiplication factor;
temp1Proc, temp2Proc, temp3Proc, temp4Proc - Variables for
saving intermediate calculations of procedures;
k - Addition coefficient. }
// The procedure multiplies the matrix by a factor
Procedure koefUmn(const Mas1: TMas; var temp: TMas; const i: integer);
{ Mas1 - parameter value: array;
temp - parameter variable: array to save the value;
i - parameter variable: integer to use coefficient. }
Var
m, l, tempP: integer;
{ m,l - array index local variables. }
// We multiply each element of the matrix by a coefficient
Begin
asm
mov ecx, Mas1;
end;
for m := 1 to 3 do
begin
for l := 1 to 3 do
begin
asm
mov ebx, i;
mov eax, [ecx];
mul ebx;
add ecx, 1;
mov tempP, eax;
end;
temp[m, l] := tempP;
end;
end;
{ for m := 1 to 3 do
begin
for l := 1 to 3 do
begin
temp[m, l] := Mas1[m, l] * i;
end;
end; }
End;
// The main program block
Begin
End.

