<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 18 Sep 2003 23:51:46 +0100
From   : Sprow <info@...>
Subject: Re: DFS Execution address of BASIC program

In article <20030918215240.25902.qmail@...>,
   Steve Fewell <kranser@...> wrote:
> During my analysis of the BASIC ROM, I found that, on
> the BBC Master, when BASIC saves a program it sets the
> (DFS) Execution address to &802B - this is the main
> start address of the BASIC language.

It should be the "warm start" entry point,which will validate a few magic
pointers then plop you back at the '>' prompt.

> Does anyone know why it does this, or what purpose it
> serves?

All files need an execution address,and BASIC saves what it knows to be a
'safe' address in its place - as there always has to be some program running
(be it a standalone program like a game,or a language like PASCAL) so it
can't just be a pointer to an RTS instruction.

You'll note the address is different for BASIC I and BASIC II,which might be
useful in working out what version it was saved with.

> I have tried to *PROG and *EXEC PROG (where PROG is a
> BASIC program), and neither of these OS commands loads
> the file and jumps to address &802B (in the hope that
> the program will be executed).

*EXEC just opens the file and types the bytes into the input buffer as
though entered from the keyboard so you shouldn't expect it to do anything
(other than beep at you and probably give loads of error messages) and
*RUNning it will just load the program at PAGE and restart BASIC.
You should be able to list the program at that point though,
Sprow.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>