Ignore:
Timestamp:
Jan 14, 2022, 7:13:36 PM (3 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/UTargetFPC.pas

    r125 r126  
    6969  AddLine('Pos := 0;');
    7070  FProgramIndex := 0;
    71   while (FProgramIndex < Length(FProgram)) do begin
     71  while FProgramIndex < FProgram.Count do begin
    7272    case FProgram[FProgramIndex].Command of
    7373      cmPointerInc: AddLine('Inc(Pos, ' + IntToStr(FProgram[FProgramIndex].Parameter) + ');');
     
    7676      cmDec: AddLine(GetMemoryCell + ' := ' + GetMemoryCell + ' - ' + IntToStr(FProgram[FProgramIndex].Parameter) + ';');
    7777      cmSet: AddLine(GetMemoryCell + ' := ' + IntToStr(FProgram[FProgramIndex].Parameter) + ';');
    78       cmMultipy: AddLine(GetMemoryCell + ' := ' + GetMemoryCell + ' + Memory[Pos] * ' + IntToStr(FProgram[FProgramIndex].Parameter) + ';');
     78      cmMultiply: AddLine(GetMemoryCell + ' := ' + GetMemoryCell + ' + Memory[Pos] * ' + IntToStr(FProgram[FProgramIndex].Parameter) + ';');
    7979      cmOutput: AddLine('Write(Chr(' + GetMemoryCell + '));');
    8080      cmInput: AddLine('Read(ReadChar); ' + GetMemoryCell + ' := Ord(ReadChar);');
Note: See TracChangeset for help on using the changeset viewer.