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/UTargetPHP.pas

    r125 r126  
    6666  AddLine('$Position = 0;');
    6767  FProgramIndex := 0;
    68   while (FProgramIndex < Length(FProgram)) do begin
     68  while FProgramIndex < FProgram.Count do begin
    6969    case FProgram[FProgramIndex].Command of
    7070      cmPointerInc: AddLine('$Position = $Position + ' + IntToStr(FProgram[FProgramIndex].Parameter) + ';');
     
    7777      cmInput: AddLine(GetMemoryCell + ' = fgetc(STDIN);');
    7878      cmSet: AddLine(GetMemoryCell + ' = chr(' + IntToStr(FProgram[FProgramIndex].Parameter) + ');');
    79       cmMultipy: AddLine(GetMemoryCell + ' = chr(ord(' + GetMemoryCell + ') + ord($Memory[$Position]) * ' + IntToStr(FProgram[FProgramIndex].Parameter) + ');');
     79      cmMultiply: AddLine(GetMemoryCell + ' = chr(ord(' + GetMemoryCell + ') + ord($Memory[$Position]) * ' + IntToStr(FProgram[FProgramIndex].Parameter) + ');');
    8080      cmLoopStart: begin
    8181        AddLine('while(' + GetMemoryCell + ' != "\0") {');
Note: See TracChangeset for help on using the changeset viewer.