www.retrosoftware.co.uk
http://www.retrosoftware.co.uk/forum/

Why can't I call my assembler program from basic?
http://www.retrosoftware.co.uk/forum/viewtopic.php?f=73&t=917
Page 1 of 1

Author:  jbnbeeb [ Sun Oct 19, 2014 6:10 pm ]
Post subject:  Why can't I call my assembler program from basic?

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?

Author:  sweh [ Sun Oct 19, 2014 9:35 pm ]
Post subject:  Re: Why can't I call my assembler program from basic?

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
>

Author:  jbnbeeb [ Sun Oct 19, 2014 9:45 pm ]
Post subject:  Re: Why can't I call my assembler program from basic?

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]

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/