A new free dos BASIC compiler in development

Marcel Smolenaars, 25th august 1998


Since you're all setting up plans to create a basic compiler, I decided to
let you take a look at my work in designing a BASIC compiler, for educational
reasons. Making a compiler certainly isn't simple.
I certainly hope this won't spoil your fun in making your own..

I've called it qb50 for now.. It's only the working name (and a lousy one I
must say :-) It is made using MS PDS 7.1 .
I'm working on it for about one and a half year, and I've come a long way
since then. It's a one-pass compiler that generates moderately good 386+
assembly code for real mode, which can be compiled by tasm and masm
For now, the compiler requires all variables to be declared.

Already implemented are:
- expressions: e.g. n=(x*(20-b/a)-function1(a*b,x*(z-y),b)) works out fine
- variable and constant declarations (local and global)
- function|sub declaration and calling
- program flow constructs: DO..LOOP (WHILE/UNTIL)
  IF..THEN(..ELSEIF ELSE END IF block), FOR..NEXT, SELECT CASE,
  EXIT IF|FOR|SELECT|DO
- variable types integer,byte,long

Under construction:
- arrays (nearly done)

Not done yet:
- by reference parameter passing to functions.
- user defined types
- pointers
- strings! (requires dynamic memory allocation)
- automatic type conversion
- standard library (you can't even PRINT anything)

As you can see, I already have done some neat stuff, but it I'll take some
more time to finish this project.
I'll need somebody to help me creating a standard library. If you think
you're a damn good programmer, and you can proof that to me, you really
really want to do it, e-mail me at the address below so we can discuss about
it. It would be very nice if you have some experience in compiler/standard
library construction.

Now, about what you're getting:
I DO NOT TAKE ANY RESPONSIBILITY FOR ANYTHING THAT MAY HAPPEN WITH THE THINGS
YOU DO WITH THESE FILES. YOU MAY ONLY USE THESE FILES UNDER THE CONDITION
THAT YOU DO NOT SPREAD THESE FILES. YOU ARE NOT ALLOWED TO USE OR MODIFY ANY
SOURCE CODE.

What you're getting is _all_ the source for the compiler. Since it is in an
early development phase, I ask you NOT TO SPREAD it. DO NOT USE OR MODIFY
THE SOURCE CODE FOR YOURS OR OTHERS PURPOSES. DO NOT PUT IT ON A HOMEPAGE.

Now, I hope you can bring up the respect for me and my work to follow these
rules.

You can download a copy of the package at:
http://www.geocities.com/SiliconValley/Park/9751/newbasic.zip

In it you will find:
- read.me (this file)
- the main source file: qb50.bas, the accompanying modules error.bas,
  symtest.bas, qb50util.bas, and the include files: incerror.bi, inc_io.bi,
  incsym.bi and incutil.bi. The source code is extensively commented.
- an executable: qb50.exe
- the test source file tst.bas
- the great utility LIST (I renamed it into "l", because it's so good I
  really want to start it up as fast as possible)
- some unfinished text files, with notes and descriptions.


What it will do:

When you execute qb50.exe, it will compile the file tst.bas to tst.asm ,
next it will invoke list to show you the resulting file tst.asm .


What I plan to do:
My intention is to provide this compiler for free, with the source code.


Some notes:
Do not send me e-mails like: "Hey! This and that went wrong! Can't you make it
work decently, moron." This program is under heavy development. Don't send me
bug reports. This isn't even an alpha version. I've released it only for
educational purposes.


Marcel Smolenaars
smolenaa@sci.kun.nl
