It is currently Mon Oct 20, 2014 4:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Oct 06, 2011 12:41 pm 
Offline
 Profile

Joined: Fri Nov 07, 2008 2:28 pm
Posts: 65
Hi There,

The following program:

NOTE_B0 = 0
.START:
EQUB NOTE_B0
.END:
SAVE "PROG",START,END


will not compile with the error:

test.asm:3: error: Symbol not defined.

EQUB NOTE_B0
^

Is the word NOTE special?

Thanks for any help

- PJ


Top
 
PostPosted: Thu Oct 06, 2011 12:46 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
No, but the function NOT is :) BeebAsm is interpreting that line as EQUB NOT(E_B0), i.e. looking for a symbol called E_B0. BBC BASIC is the same - that wouldn't have allowed you to have a variable 'NOTE' either.

In lower case, 'note' would be fine.

However you have found a bug, in that the variable declaration on line 1 is working without problems. I'll have to have a look at that.


Top
 
PostPosted: Thu Oct 06, 2011 1:09 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
I'm thinking that perhaps the solution here is to require all function keywords to be followed directly by an open bracket, i.e.
Code:
NOT(x)
rather than
Code:
NOTx

This is different to BBC BASIC, in which most functions need not enclose their parameter in brackets.

But it might fix these kind of problems (in particular those caused by starting variables with LO and HI).

Any thoughts, anyone? Would this break anyone's source code?


Top
 
PostPosted: Thu Oct 06, 2011 5:42 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 24, 2011 6:10 pm
Posts: 29
I like the parenthesis suggestion! If this change breaks any existing code, it's an easy fix ;)

I've been bitten by this previously - I believe it was some label starting with LOOPBlahBlah, being reported as not being defined, when it clearly was! (I assumed LOOP was somehow causing grief - the LO keyword never dawned on me :roll: ). Once I converted this code (not mine!) to lowercase (my preference), the problem went away.

Personally, I don't really mind either way. I know what to look out for now :) .


Top
 
PostPosted: Thu Oct 06, 2011 6:03 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
'tis done! version 1.07 is available right now with this change.


Top
 
PostPosted: Fri Oct 07, 2011 2:19 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 24, 2011 6:10 pm
Posts: 29
You certainly don't hang around. Thank you for the update :)


Top
 
PostPosted: Fri Oct 07, 2011 3:15 pm 
Offline
 Profile

Joined: Fri Nov 07, 2008 2:28 pm
Posts: 65
Thanks - works great - and that was fast!


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron