Jump to content
IGNORED

I can not get data statements to work.


Robert M

Recommended Posts

I am having problems using data statements. They compile without errors, but no code is generated. For example if I write the following code:

 

	data XphaseEventTable
0,23,46,69,92,115,138,161,184,207
end

 

Only the label for the data statement appears in the asm file. Here is the generated code I am seeing:

 

.L0189;  data XphaseEventTable

JMP .skipL0189
XphaseEventTable
.skipL0189
.
;

 

Am I missing something on the syntax of data statements, or is this a bug?

 

Cheers!

Link to comment
Share on other sites

I copied your code in the post above into a empty text file and compiled it. It compiled correctly. See below:

 

.L00 ; data XphaseEventTable

 

JMP .skipL00

XphaseEventTable

.byte 0,23,46,69,92,115,138,161,184,207

 

Note: didn't bother to set the formatting.

 

I would try doing that and see what happens. If it still doesn't work, something may be corrupt in your installation. You could try a clean install to a different folder and see what happens.

 

EDIT: It could also be a bug in the MSK (if you are using it). Didn't have time to check what happened if I compiled the above in it.

Edited by s0c7
Link to comment
Share on other sites

Aha!

 

When I cut and paste my own code, it compiles correctly!

 

It looks like the data statement must be indented with only space characters. If you use a tab character to indent, the data statement compilation fails. I am not sure if this is a bug. Tabs are generally considered to be valid whitespace, but the bBasic manual does not specify what characters are treated as whitespace.

 

Cheers!

Link to comment
Share on other sites

Aha!

 

When I cut and paste my own code, it compiles correctly!

 

It looks like the data statement must be indented with only space characters. If you use a tab character to indent, the data statement compilation fails. I am not sure if this is a bug. Tabs are generally considered to be valid whitespace, but the bBasic manual does not specify what characters are treated as whitespace.

 

Cheers!

Thanks for finding that bug - I tracked it down and fixed it. Was due to a bad way of checking for a string-terminating NULL, CR or LF (I checked ASCII value <14, which also includes TAB.)

 

sdata has the same bug (and the same fix.)

Link to comment
Share on other sites

Thanks for finding that bug - I tracked it down and fixed it. Was due to a bad way of checking for a string-terminating NULL, CR or LF (I checked ASCII value <14, which also includes TAB.)

 

sdata has the same bug (and the same fix.)

 

Great! Thanks for the fast response time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...