[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with BASIC....



Invalid Opcode (demstar@fn.net) wrote:
: 	I have a series of files that appear mostly AppleBASIC, with the
: exception of a very strange token.  The token is interpreted as the &
: token by AppleBASIC, but it causes syntax errors the way it's used.
: Some examples of usage are:

: 100 &B,1,38,1,23
: 200 &5,253+DD
: 300 &G,3-PEEK(32),21

: 	It seems to take an arbitrary number of parameters, can take variable
: names and numeric constants in any order, and can use the results of
: other tokens as parameters.  However, all three of these examples
: cause syntax errors under AppleBASIC.

First of all, you aren't nuts.  "&" is a valid Applesoft command.  What
"&" does is execute a branch to a three-byte vector in Page 3, at
$3F5-$3F7.  That's the "Ampersand Vector."  Normally, that vector contains
4C 03 E0 (JMP $E003) on the IIgs, which is the Applesoft entry point. 
Earlier ROM versions were not set and could cause a crash to the monitor.

The program in question is calling a machine language library.  That
machine language program is supposed to continue parsing values from the
Applesoft program so that it knows how to behave.  

An early application of this was Apple's RENUMBER utility; another was the
Applesoft Programmer's Assistant, a utility package in the DOS Tool Kit.

Since the program you're working with doesn't work right, I'd say that the
machine language library is missing, or the correct address of that
library has not been POKEd into the & vector.

--Dave Althoff, ][.
-- 
    /-\        _       _  /|           __*** Closed for the season ***
   /XXX\      /X\    _/X / |    _     /XX\_      _     _        _____  
  /XXXXX\    /XXX\  <#&>/X |   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/o==oXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX