Ignore:
Timestamp:
Jan 14, 2022, 7:13:36 PM (2 years ago)
Author:
chronos
Message:
  • Modified: SetZero optimization made as separate step.
  • Fixed: Error during compilation in CopyMultiply optimization.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/UTargetInterpretter.pas

    r125 r126  
    8383  SProgramUpperLimit = 'Program run over upper limit';
    8484  SJumpTableInsistent = 'Jump table is inconsistent';
    85   SJumpTableColision = 'Jump table colision';
     85  SJumpTableCollision = 'Jump table collision';
    8686  SProgramNotRunning = 'Program not running';
    8787  SUnsupportedCommand = 'Unsupported command';
     
    9595  with Parent do
    9696  repeat
    97     while (FProgramIndex < Length(FProgram)) and (State <> rsStopped) do begin
     97    while (FProgramIndex < FProgram.Count) and (State <> rsStopped) do begin
    9898      if State = rsRunning then begin
    9999        if FProgramBreakpoints[FProgramIndex] then begin
     
    154154  I: Integer;
    155155begin
    156   for I := 0 to Length(FProgram) - 1 do begin
     156  for I := 0 to FProgram.Count - 1 do begin
    157157    case FProgram[I].Command of
    158       cmLoopStart: FProgram[I].Parameter := 0;
    159       cmLoopEnd: FProgram[I].Parameter := 0;
     158      cmLoopStart: FProgram.Operations[I].Parameter := 0;
     159      cmLoopEnd: FProgram.Operations[I].Parameter := 0;
    160160    end;
    161161  end;
    162162
    163163  SetLength(Loop, 0);
    164   for I := 0 to Length(FProgram) - 1 do begin
     164  for I := 0 to FProgram.Count - 1 do begin
    165165    case FProgram[I].Command of
    166166      cmLoopStart: begin
     
    170170      cmLoopEnd: begin
    171171        if FProgram[I].Parameter > 0 then
    172           raise Exception.Create(SJumpTableColision);
    173         FProgram[I].Parameter := Loop[High(Loop)];
     172          raise Exception.Create(SJumpTableCollision);
     173        FProgram.Operations[I].Parameter := Loop[High(Loop)];
    174174        if FProgram[Loop[High(Loop)]].Parameter > 0 then
    175           raise Exception.Create(SJumpTableColision);
    176         FProgram[Loop[High(Loop)]].Parameter := I;
     175          raise Exception.Create(SJumpTableCollision);
     176        FProgram.Operations[Loop[High(Loop)]].Parameter := I;
    177177        SetLength(Loop, Length(Loop) - 1);
    178178      end;
     
    303303  I: Integer;
    304304begin
    305   SetLength(FProgramBreakpoints, Length(FProgram));
     305  SetLength(FProgramBreakpoints, FProgram.Count);
    306306  for I := 0 to High(FProgramBreakpoints) do
    307307    FProgramBreakpoints[I] := False;
    308308  for I := 0 to BreakPoints.Count - 1 do
    309     if TBreakPoint(BreakPoints[I]).TargetAddress < Length(FProgramBreakpoints) then
    310       FProgramBreakpoints[TBreakPoint(BreakPoints[I]).TargetAddress] := True;
     309    if BreakPoints[I].TargetAddress < Length(FProgramBreakpoints) then
     310      FProgramBreakpoints[BreakPoints[I].TargetAddress] := True;
    311311end;
    312312
     
    316316begin
    317317  Result := '';
    318   for I := 0 to Length(FProgram) - 1 do begin
     318  for I := 0 to FProgram.Count - 1 do begin
    319319    Result := Result + GetOperationText(FProgram[I]);
    320320  end;
     
    438438  // Extended commands
    439439  FCommandTable[cmSet] := CommandSet;
    440   FCommandTable[cmMultipy] := CommandMultiply;
     440  FCommandTable[cmMultiply] := CommandMultiply;
    441441end;
    442442
Note: See TracChangeset for help on using the changeset viewer.