tebe6502 / Mad-Pascal

Mad Pascal Compiler for 6502 (Atari XE/XL, C64, C4Plus, Neo6502)
122 stars 20 forks source link

two peeks with an and clause might compile wrongly? #127

Closed aydindemircioglu closed 10 months ago

aydindemircioglu commented 10 months ago

i dont have a minimal working example right now, but this code

              if (Peek(j + 2) = 0) and (Peek(j + 40 + 2) = 0) then ...

did not work; the first check was ok, but the second translated into a simple LDY, and the real 'peek' like LDA (..),Y was missing. rewriting the lines to this

                     if (Peek(j + 2) = 0) then 
                        if (Peek(j + 40 + 2) = 0) then ...

worked. i think mad pascal might 'over'-optimize here?