Odd "Syntax error"

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
julie_m
Posts: 353
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Odd "Syntax error"

Post by julie_m »

A couple of times now I've called a buggy machine code subroutine and it has returned to BASIC with 'Syntax error'.

The only thing I can see that might have been responsible is a STA 0,X which I guess could have stomped on some zero-page variable used by BASIC, if X was wrong, and messed up the interpretator state; either by setting an error flag or by altering the "next byte of program" pointer and causing it to read nonsense.

Does that sound likely? I can't seem to reproduce it .....
User avatar
Bobbi
Posts: 707
Joined: Thu Sep 24, 2020 12:32 am
Contact:

Re: Odd "Syntax error"

Post by Bobbi »

If you leave the stack imbalanced it will often result in spurious BASIC errors.
gfoot
Posts: 172
Joined: Tue Apr 14, 2020 9:05 pm
Contact:

Re: Odd "Syntax error"

Post by gfoot »

Like "OSCLIOSCLIBPUT#PLOTMID$(WIDTH at line 830"!
julie_m
Posts: 353
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: Odd "Syntax error"

Post by julie_m »

I've had the OSCLIOSCLIOSCLI stuff before, and modified my editing technique to avoid it.

Anyway, I've managed to reproduce the fault. Writing &00 to location &0C causes 'Syntax error'!

I'll find a BASIC IV disassembly and see what that address does.
Post Reply

Return to “programming”