Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
InLine ASM Bug
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).

; 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=""> ... 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.

Messages In This Thread

Forum Jump:

Users browsing this thread: 1 Guest(s)