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

Re: Tools for BAS to WAV?



Linards Ticmanis wrote:
>> the cassette LOAD routine does the following:
>> 
>> - read 3-byte header from tape (program length + lock flag)
>> - store program end address at $69/6A
>> - store lock byte at $D6
>> - load program from tape
>> - if locked, start running, otherwise jump to "FIX.LINKS" routine 
> 
> No more details though. I assume "FIX.LINKS" repairs the pointer to the
> next line that precede every tokenized line of BASIC code. The function
> would be to allow for relocating BASIC code for different RAM size
> machines, especially important for Integer BASIC, which stores lines
> from HIMEM downward rather then from LOMEM upward.
> 
> Probably you wouldn't want this to happen with your code, so you'd set
> the lock byte to "true" (whatever that value is).
>

Hm.

The "lock byte" is the byte that makes every command equivalent to RUN.  A
NEW will set it to 0.  True is "Minus" (it's always compared with a BPL), so
128-255 are considered true.

For Applesoft BASIC (the wrapper I use is specifically Applesoft) it's
usually a safe bet the code will remain sitting at $0801, an assumption my
code and that of Exomizer relies on.

Looks like it reads 3 bytes at $50, with $50 being a word containing the
length of the file in low endian (well, it *is* a 6502), and $52 being the
LOCK byte.  If I set this to HIGH, it may be possible to initiate the
process with only one command (LOAD).

-uso.