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

Re: BASIC Question



Joe Walters writes ...
> 
> I'm in the process of modifying the BASIC program, "HOME ACCONTANT,"
> ....
> 
> Things are going somewhat well until I come to the BASIC file, MEMOS.
> It has the following lines:
> 
> 10 GOSUB 60000
> 
> 60000 *
> 60025 DATA LOTSA STUFF
> 60030 ** DATA MORE LOTSA STUFF
> 
> My problem is that I need to modify line 60000 from within Program
> Writer. When I try I'm told that the "Line is too long." Hard to
> believe that a single "*" is too long. What am I missing?
> ....


     An asterisk is PW's way of indicating that it believes a line is too 
long to display as a legal Applesoft BASIC line. (PW will, sometimes, 
mess up and show bogus high-numbered lines. It's a fairly low-prob bug.) 
 
     Try just loading the program (i.e. without Program Writer) and LIST 
the program. If Line 60000 and other odd lines look long but, otherwise, 
okay, you can move part of a long line to another line and have two lines 
PW will accept. (Be sure to adjust for any tests and branches which may 
be built in to a too-long line.)

     If Line 60000 lists as a GOTO xxxx (or, possibly, actual subroutine 
commands) followed by a REM full of garbage it may be a case of, mainly, 
embedded machine code. The designers just thought it would be neat to 
have part of the line be genuine BASIC code which needs to executed.

(By the way, Line 10 may not even be the actual first line of the 
program. Earlier lines may be masked. You can check this by doing a CALL 
-151 to the monitor and looking at the first line's Line number which 
should be at $803. It should be 0A 00 = decimal 10.)  

     You can sniff out embedded machine code by looking for CALLs, PEEKs, 
POKEs to addresses that seem likely to land in the middle of the program. 
A firly quick test is to add a short REM near the start of the program. 
If the program bombs, it is an indication that machine code has been 
moved (due to the addition of the REM) and no longer functions as 
intended.

     Another check is to go to the monitor and search for 60 EA. This is 
60000 in hex with low byte first as it will appear in memory. The 60 EA 
you want should be fairly close to the end of the program in memory. If, 
a little further up in memory, you find sane looking machine code, it is 
an indication of embedded stuff.

     Editing a program with embedded machine code or machine code which 
has been tacked on to the end of a BASIC program (or large gaps 
intended for bringing in BASIC code overlays) can be tricky. With luck, 
you will need to just break up a few normal overly long lines.


Rubywand