04-21-2010, 08:24 AM
I have a program (fourspriter. Yet again!) that has a compilation error "no such label". Except I can see it. Right there! :-)
Am I going crazy?
I copied and pasted the following code into a separate project:
And it compiled perfectly. Which is bad, because this is FULL of references that don't exist. However, when I try the main code block, it reports:
FourSpriter3.bas:906: Error: Undefined label 'fspUpdateAsm'
Now, quite apart from the fact that line 906 reads " ;LD BC,2120 "- which means I have to hunt down the line it really means, that label is only used in two places. Both of those places are shown in the code above. One call and one arrival point.
I have NO idea why it's doing this. It's weird that it doesn't like the label in the main program, and yet is fine with all those other undefined labels in the part above. Any idea what's going on here?
Am I going crazy?
I copied and pasted the following code into a separate project:
Code:
SUB FASTCALL fspUpdate()
asm
fspUpdateAsm:
ld hl, fspDataStartAsm+1 ; Points to sprite 1
ld de, fspDataStartAsm+3
ldi
ldi
ld hl, fspDataStartAsm+1+43 ; Points to sprite 2
ld de, fspDataStartAsm+3+43
ldi
ldi
ld hl, fspDataStartAsm+1+43+43 ; Points to sprite 3
ld de, fspDataStartAsm+3+43+43
ldi
ldi
ld hl, fspDataStartAsm+1+43+43+43 ; Points to sprite 4
ld de, fspDataStartAsm+3+43+43+43
ldi
ldi
ret
END asm
END SUB
SUB fspCollisionCheck()
END SUB
SUB FASTCALL fspRedraw()
fspCollisionCheck()
asm
halt
call fspEraseAsm
call fspBufferAndDrawAsm
call fspUpdateAsm
end asm
END SUB
fspRedraw()
And it compiled perfectly. Which is bad, because this is FULL of references that don't exist. However, when I try the main code block, it reports:
FourSpriter3.bas:906: Error: Undefined label 'fspUpdateAsm'
Now, quite apart from the fact that line 906 reads " ;LD BC,2120 "- which means I have to hunt down the line it really means, that label is only used in two places. Both of those places are shown in the code above. One call and one arrival point.
I have NO idea why it's doing this. It's weird that it doesn't like the label in the main program, and yet is fine with all those other undefined labels in the part above. Any idea what's going on here?