05-28-2010, 07:31 AM
britlion Wrote:ZX BASIC doesn't work out line numbers in ASM sections well - it ignores comments, so you have to add on for each of the comment lines above it to get the right number. I've bugged this before. As a workaround, in ASM sections, when I can't find the problem like this, I insert a dummy code like "LD F,G" at the line it says, and then it tells me what line it THINKS that is, and I get an idea how much farther down to look. A few tries of that dummy opcode, and you find the line it means.That's right. I will work on it MUCH later. Meanwhile, use the #line directive (It's a very standard directive).
Code:
...
...
; Next line resets linecounter to 372
#line 372
sdafasdffasfa ; Syntax error at line 372
You can also specify a diferent file name. So
#line 372 "newfile.bas"
will not only change the line counter, but the supposed filename in the error messages.
This is a standard directive in many compilers: <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/b5w2czay%28VS.80%29.aspx">http://msdn.microsoft.com/en-us/library ... 80%29.aspx</a><!-- m -->
ZX Basic already put #line directives on the fly during file includes (that's what most compilers do, BTW). But when inlining ASM it stil does not. Needs to be fixed.