Re: Pointer at the start of a BASIC line: what good is it?

From: Ethan Dicks <ethan.dicks_at_gmail.com>
Date: Mon, 1 Nov 2021 13:52:01 -0400
Message-ID: <CAALmimmCU0377ENw5ovt_TLdB=koTRpxjWkPg3QRB4eom+FZbA_at_mail.gmail.com>
On Sat, Oct 30, 2021 at 9:37 PM gsteemso <48bitsorbust_at_gmail.com> wrote:
> On Oct 29, 2021, at 4:19 PM, Ethan Dicks <ethan.dicks_at_gmail.com> wrote:
> > I believe that's true for the VIC-20 and C-64 but not for the PET.
> > I.e., you can load a program with pointers from any base address into
> > a VIC-20 or C-64 and just "RUN", but the PET will load at the load
> > address and not recalculate (nor repoint).
>
> As far as I am aware, this is correct... _mostly_.
>
> I believe the distinction is something like, if you do a {LOAD "file",unit} the above behaviours apply; if, on the other hand, you do a {LOAD "file",unit,1} then newer-model BASICs will blindly honour the load address stored in the file (extremely useful for machine-language code).

Yes.  That is correct, but except for rare cases, one does not LOAD
"file",unit,1 a BASIC program on a VIC-20 or C-64.

> The two behaviours are made less obscure via new keywords in BASICs 4.7 and 7 (the BLOAD and DLOAD commands).

I did not know that (I don't use any CBM machines that new ;-)

> Analyzing the exact behaviour of a bare LOAD command, vs. one which explicitly states the normally-implied secondary address of zero, vs. one with a secondary address of one, is greatly complicated by the distinction between how a specific version of BASIC interprets it and how any specific IEEE-488 or Commodore Serial Bus device will interpret it.

Agreed.

AFAIK, it breaks down this way - in the beginning (PET BASIC), there
was just "LOAD".  It always honored the start address, and BASIC
programs always started from $0401.  With the VIC-20, that changed -
the BASIC start address could move based on how much RAM was
installed, so a new feature was to use the secondary address of 1 to
mean "honor the start address at the front of the file" and the
original syntax meant to relocate your code to the start of BASIC (and
re-chain the forward pointers).  Past the C-64 is past my experience
but in 1982, that's where it all stood.

-ethan
Received on 2021-11-01 19:02:40

Archive generated by hypermail 2.3.0.