+atari2600land Posted December 6, 2017 Share Posted December 6, 2017 I want to see if a variable has reached the value of another variable. How do I do this? This code won't work: ldy TongueYMoving iny sty TongueYMoving ldx ScreenDrawing cpx #TongueYMoving beq DisableBall Quote Link to comment Share on other sites More sharing options...
carlsson Posted December 6, 2017 Share Posted December 6, 2017 Skip the # as it indicates an immediate value, not a memory location. inc TongueYMoving ldx ScreenDrawing cpx TongueYMoving beq DisableBall ; branch if the two are equal You might want another branch instruction depending on which circumstances the branch should occur. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 6, 2017 Author Share Posted December 6, 2017 OK. Thank you. I was about to say it didn't work, but then I got the other surrounding code changed and it does what I want it to now. 1 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.