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

Re: BASIC and the nitty-gritty of DOS 3.x





On Fri, 5 Dec 2008, sicklittlemonkey wrote:

On Dec 4, 12:46 pm, lyricalnanoha
<lyricalnan...@usotsuki.hoshinet.org> wrote:
For kicks, I ported the SYM-1 BASIC (a little brother of FPBASIC) to the
Apple.  Why?  I happened to have the source code, and it was small. :P

I was thinking about how to implement LOAD and SAVE on it, which I really
don't know much about.  The ZP stuff is very different from the Apple's
but shares some resemblance, e.g., USR vector is at the same address.  I
didn't need the $0200-$02FF space so it lies fallow.

I was thinking of trying to come up with a modified "DOS 3.3 lite" that I
could use to load and save the files (as type S).  There's a few problems.

1. Although the loaders (for 48K and 64K symbasic) do not ratdance on DOS,
the interpreter dances on zero page.  The code would need to be edited to
use different ZP addresses so as not to step on important variables.

Note - the input buffer is in zp from $1E to $65, and can prolly be used
for scratch variables that don't need to be maintained.  Most of the $Ex
and $Fx area seems to be safe too - I use $F0-$F3 internally.  The code
sits from $6000-$81D1 on the 48K version, $D000-$F1E1 on the 64K version.
(The additional code is mostly to handle Reset.)

2. I don't know how to do the equivalent of a bload or bsave without the
help of the BASIC interface, which I won't have available.

-uso.

If it's only LOAD and SAVE you're after, the quickest and simplest
hack is probably to "page" in and out the ZP for DOS by copying it
somewhere before and after using DOS.

The time to do that will pale in comparison to disk IO.

Cheers,
Nick.


I came up with the same idea in order to not have to override the whole monitor. Also added some safety so 48k symbasic can't eat itself if someone doesn't reply to MEMORY SIZE?

I'm thinking I might need to take the 48K/24K version and expand on that. I don't know much about the APIs though. I suppose ProDOS 8 is easier to work with as it was designed with machine language in mind.

I'll have to find out what zp addresses hold the program code. I suspect it's the same ones FPBASIC uses.

-uso.