+atari2600land Posted October 16, 2010 Share Posted October 16, 2010 Why is this allowed: if d=3 && pfread(a, b) then c=0 and this isn't? if pfread(a, b) && d=3 then c=0 I've often wondered that. Anyway, these variables are just examples and don't really connect to anything i'm working on. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted October 16, 2010 Share Posted October 16, 2010 Why is this allowed: if d=3 && pfread(a, b) then c=0 and this isn't? if pfread(a, b) && d=3 then c=0 It isn't a question of being "allowed" or not. It seems there's a bug in the compiler that prevents the second version from compiling correctly. Here's the compilation and assembly of the first version: .L01 ; if d = 3 && pfread ( a , b ) then c = 0 LDA d CMP #3 BNE .skipL01 .condpart0 LDA a LDY b jsr pfread BNE .skip0then .condpart1 LDA #0 STA c .skip0then .skipL01 Here's the second version: .L01 ; if pfread ( a , b ) && d = 3 then c = 0 LDA a LDY b jsr pfread BNE .skipL01 .condpart0 ; complex statement detected LDA #3 PHA LDA then PHA LDA c PHA LDA = PHA LDA #0 STA d .skipL01 The pfread compiles correctly either way, but for some reason the compiler thinks there's a complex statement after the &&, so it compiles that part incorrectly. Michael Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.