Re: BASIC OS for the PC

From: Spiro Trikaliotis <ml-cbmhackers_at_trikaliotis.net>
Date: Tue, 20 Dec 2016 13:28:14 +0100
Message-ID: <20161220122814.GA451@hermes.local.trikaliotis.net>
Hello Ruud,

as always, I will not ask for the "why" and just go directly into the
details. ;)

* On Tue, Dec 20, 2016 at 10:35:35AM +0000 Baltissen, GJPAA (Ruud) wrote:
 
> "Basic OS for the PC" is a project that started three years ago just as a fun
> project because I was a bit fed up with the 6502 at that  moment. The idea was
> to make an OS that uses BASIC as base, just like the C64 does, and it should be
> able to run on an 8088 machine with only one 360 KB floppy, like the Commodore
> PC1. It still is an "in between" project and therefore there is only a slow
> (but steady) progress.

Is it written in 8086/8088 assembler, or in a high-level language?

Is the source available somewhere? ;)

> Commodore BASIC uses tokens to save the original code in memory and on disk.
> One of my idea was to skip the tokens. Because I can skip the conversion then,
> it simplifies saving the program lines and listing them again. The greatest
> disadvantage however is that I will loose time when running the program. So I
> will stick to the tokenizing. (unless somebody has a better idea)

I believe two formats, one "in memory format" (with tokens), and one
"on disk format", plain-text when storing the program externally, should
give you more advantage.

You can use any editor externally, but you can also do any optimisations
you like internally. You can even change the in-memory-format as often
as you like, as it will not affect the on disk format.

> Another advantage of using tokens is that IMHO I should be able to run
> Commodore PRGs without any conversion.

You could "automagically" recognise CBM BASIC programs (start address
with a $01 as first byte, and "reasonable" linking addresses before each
line) and convert it "on the fly" to your in-memory-format.

> Commodore stores variables in programs by storing the complete name. Another
> idea I have is to replace the name by three bytes: one token and two bytes.
> These two bytes point directly to the data. Advantage: no search for the data
> needed anymore. Disadvantage: I loose compatibility with Commodore's PRG.

See above, the disadvantage is not as big if you use a specific
in-memory-format that does not need to be identical to the external
format(s).

You could also add a destination address for GOTO/GOSUBs, so you do not
have to search the line targets over and over again).


Regards,
Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/

       Message was sent through the cbm-hackers mailing list
Received on 2016-12-20 14:00:03

Archive generated by hypermail 2.2.0.