It is currently Mon Oct 20, 2014 3:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Oct 19, 2014 6:10 pm 
Offline
User avatar
 Profile

Joined: Thu Feb 02, 2012 4:24 am
Posts: 68
Hi
I've written a bit of code I want to run from within a basic program.
Code is written in Beebasm.

If I try this in BASIC, I get " at line 30" and the program stops:

Code:
10 MODE 5
20 *LOAD MYCODE   (nb it loads at &2000)
30 CALL &2000
40 <program continues>
.
.



*RUN MYCODE produces same error. I can CALL and *RUN MYCODE fine at the BASIC prompt.

What am I doing wrong?


Top
 
PostPosted: Sun Oct 19, 2014 9:35 pm 
Offline
 Profile

Joined: Sat Mar 10, 2012 10:27 pm
Posts: 41
This may sound a little like teaching granny to suck eggs but...

In theory it should work :-)

What is TOP? VARTOP (!2 AND &FFFF). Does your code overwrite any page zero values outside of &70->&8F? Does your code properly have an RTS? Does it depend on A% X% Y% being set?

There can be lots of reasons for failure; you haven't really given enough info.

The error message is a typical one where BRK occurs without any error string. eg
>NEW
>10!&2000=0
>20CALL&2000
>30PRINT "HERE"
>RUN

at line 20
>P.ERR
0
>

Compared to
>10$2000=CHR$(0)+CHR$(200)+"Hello"+CHR$(0)
>RUN

Hello at line 20
>P.ERR
200
>


Top
 
PostPosted: Sun Oct 19, 2014 9:45 pm 
Offline
User avatar
 Profile

Joined: Thu Feb 02, 2012 4:24 am
Posts: 68
Quote:
This may sound a little like teaching granny to suck eggs but...

In theory it should work :-)


:oops: It could have been that my assembler routines were buggy !! .. Well definitely... I had a loop which wasn't exiting cleanly - and it had self modifying section in it. Yes I was overwriting code via the bugs so the code wasn't returning neatly.

EDIT: The bugs resultied in the end of the assembled code being overwritten with BRKs, as per one of the reasons you gave above.

Debugged now and the BASIC prog is running as expected.

Thanks for taking a look sweh [he said sheepishly]


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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: