[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple// CP/M question
- Subject: Re: Apple// CP/M question
- From: pausch@saaf.se (Paul Schlyter)
- Date: 2000/11/15
- Newsgroups: comp.sys.apple2
- Organization: Svensk Amat|rAstronomisk F|rening (SAAF)
- References: <3A1070CE.E6046A73@mts.net> <ztbQ5.7314$tU2.61660@news-server.bigpond.net.au> <8uro7t$af0$1@merope.saaf.se> <IGwQ5.8854$tU2.71922@news-server.bigpond.net.au>
In article <IGwQ5.8854$tU2.71922@news-server.bigpond.net.au>,
Peter Watson <paw77@NOhotmailSPAM.com> wrote:
> "Paul Schlyter" <pausch@saaf.se> wrote in message
> news:8uro7t$af0$1@merope.saaf.se...
>>> If you can't run CP/M anymore, then the file(s) can be copied to ProDOS
>>> using the Chameleon utility (as others have mentioned). I seem to
>>> remember that the layout of an MBASIC file was pretty similar to Applesoft
>>> BASIC (not too surprising, really!),
>>
>> Unfortunately, that's wrong! The tokenization of Applesoft programs is
>> really simple:
>>
>> Line number 2-byte binary
>> Line length 2-byte binary
>> Tokens 1 byte per reserved word or ASCII character
>> End-Of-Line 00h
>>
>> In Applesoft only the reserved words are stored as tokens; everything else
>> is stored in plain ASCII.
>>
>> In MBASIC the tokenization is much more complex. Reserved words are
>> stored as tokens, as in Applesoft, but other things are tokenized too:
>>
>> Integers: <token> + value as 2-byte binary
>> Short reals: <token> + value as 4-byte binary, Microsoft FP format
>> Long reals: <token> + value as 8-byte binary, Microsoft FP format
>> GOTO/GOSUB target: <token1> + target line as 2-byte binary
>> <token2> + offset to target line in tokenized program
>>
>> + some other things I don't remember now.
>
> I told you it was a long time ago! :-)
>
> I think it was only once or twice that I looked at Microsoft BASIC on the
> PC, and I remember it was constructed as you've described above. But for
> some reason, I thought that MBASIC on the Apple II used a more
> Applesoft-like method (since both were written several years earlier).
>
> But as I keep saying, the memory plays tricks these days. :-(
However, on second thoughts you may be right after all. And I may be
right too !!!!
There were several versions of MBASIC. Above I described MBASIC
version 5.2, which was the last released version of MBASIC and also
the version which was delivered with SoftCard CP/M -- that version
was quite similar to the early versions of BASICA/GWBASIC on the PC;
however the tokenizations were NOT identical.
But there were earlier versions of MBASIC too! The only one I've
actually dabbled with was MBASIC version 4, which shared some
properties with Applesoft Basic: variable names were significant only
to the two first characters, and they could not contain embedded
reserved words (in MBASIC 5 variable names were significant to all up
to the 40 characters allowed, and embedded reserved words within the
name were OK as long as not the entire name matched some reserved
word). No, I didn't look into the tokenization of MBASIC version 4,
but I could do it since I think I still have the executable file
somewhere.
And AppleSoft was a rewrite of MBASIC version 2 to 6502 assembly
language, with some stuff added for the Apple (graphics, the &
statement, etc). That "MBASIC ver 2 for 6502" did make it not only
to the Apple II, but also to the Comodore PET, the VIC-20 and the
Commodore-64 -- all somewhat modified to their particular hardware
environments. An expanded version also made it to the Apple ///
under the name "Apple Business Basic", but I cannot recall whether
Apple or MS expanded it from Applesoft.
--
----------------------------------------------------------------
Paul Schlyter, Swedish Amateur Astronomer's Society (SAAF)
Grev Turegatan 40, S-114 38 Stockholm, SWEDEN
e-mail: pausch at saaf dot se or paul.schlyter at ausys dot se
WWW: http://hotel04.ausys.se/pausch http://welcome.to/pausch