Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serious FOR bug in latest dev build s1964
#2
This is not a bug. Look:
Code:
10 FOR n=1 TO 255
20 NEXT n

This will loop until n>255. The problem is, your variable n is defined as UBYTE (or perhaps it's undefined so compiler assumed UBYTE by default?), so you will never get n>255, therefore your loop will repeat forever.

Either replace it with FOR n=0 TO 254 or redefine n as UINTEGER.

Code:
__LABEL0:
        ld a, 255
        ld hl, (_n - 1)              <-- looks a bit dodgy
        cp h
        jp nc, __LABEL3

This code is correct. There's no instruction ld h,(_n) so it's using ld hl,(_n-1) instead, which will affect h in the same way.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)