t-edson / P65Pas

CPU 6502 Pascal Compiler/IDE/Debugger
GNU General Public License v3.0
119 stars 27 forks source link

Wrong jump address with for loop #46

Closed Skertan closed 1 year ago

Skertan commented 1 year ago
program NewProgram;
uses Commodore64;
var
  x : byte;  
  y : word;
begin
  y := 0;
  for x:= 0 to 20 do
    y := y + 1;
    y := y + 1;
    y := y + 1;
    y := y + 1;
    y := y + 1;
    y := y + 1;
    y := y + 1;
  end;  
end.

Gives a BNE to $0917 it should be $0817

      $089C E6 F8    INC x 
      $089E A5 F8    LDA x 
      $08A0 C9 15    CMP #$15 
      $08A2 D0 73    BNE $0917 
;--------------------
      END
t-edson commented 1 year ago

It's fixed now. It was some missing code not updated in the REPEAT loops.

Skertan commented 1 year ago

Thank you for the quick response. For loop works now with larger content.