-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FOR LOOP repeating #178
Comments
Bump version: 1.8.7 → 1.8.8 Approved-by: Jose Rodriguez <[email protected]>
That's to be expected if x is of type FOR loops like the above means the loop must enter when x = 255, and stop when x = 256. Since x is of type UByte, it will never reach 256. Hence the infinite loop. EDIT: I repost my comment because the previous response has been lost :( |
Sorry ignore my last post on this. |
I've been thinking of an alternate (and efficient) way to implement this, by using Carry Flag (at least for 8 bits variables). Dim x as UByte
Let x = 0
Do
Print At 0, 0; x
Pause 1
Let x = x + 1
Loop Until x = 0 : REM yes, overflow |
Alternatively, the initial FOR loop will cause the Z80's Carry Flag to be set. Maybe I can take advantage of this and detect the FOR loop ending! |
I find this for loop repeats, only happens if to is set to 255
The text was updated successfully, but these errors were encountered: