QuickBasic compiler clone


0. Contents

   1. Purpose
      1.1. Project status
      1.2. Features not omitted
      1.3. Features supported if possible
      1.4. Features not considered to be supported
      1.5. Features which are gained for free
         1.5.1. Memory allocation
         1.5.2. Hardware services
      1.6. Extra features
         1.6.1. Multitasking
   2. Copying
      2.1. Documentation
   3. Requirements
   4. "I want to start programming"
   5. Downloading

1. Purpose

This is a DEVELOPMENT PROJECT. It is NOT A FINISHED PRODUCT.

Purpose is to provide tools for running QuickBASIC programs in Linux and other non-MS-DOS -environments.

It currently seems like it will become a QuickBASIC to C++ translator. In fact, it already translates a large subset of QuickBASIC to C++. However, the resulting code is not maintainable, and the library which it requires, is not finished. But it is being developed, in hopes it will one day enable running complicated DOS-specific QuickBASIC programs such as this, under Linux.

UPDATE 2008-01-27: First significant milestone: It actually compiles the BAS file linked above and runs it successfully (with only a few visual glitches)! Microsoft Nibbles also runs, with similar constraints.

1.1. Project status

  • Compiler is almost finished.
  • Runtime library implementation is being developed; simple programs already run.

1.2. Features not omitted

These features are often missing from other BASIC implementations, because they are difficult to implement or not seemed as important.
  • ON n GOTO/GOSUB
  • READ/DATA/RESTORE
  • Fully compatible INKEY$
  • TIMER function
  • Type compatibility (INTEGER must still be 16-bit signed integer etc)
  • PLAY/ON PLAY
  • DEF FN
  • Number printing and stringifying (PRINT, STR$) compatibility (spaces!)
  • OPEN: Both syntaxes
  • NEXT with comma separated list of variables
  • IF: Both syntaxes plus implicit GOTO in THEN and ELSE support.
  • PRINT abbreviated as ? support
  • String constant shortcut syntax (from GW-BASIC): closing " is not required, newline terminates
  • PRINT syntax shortcut (from GW-BASIC): parameters do not need to be separated by ;

1.3. Features supported if possible

Some of these features require emulation of PC-style hardware without direct hardware access.
  • DEF SEG &HB800/PEEK/POKE support for direct video access in text mode (SUPPORTED)
  • IN/OUT support to ports &H388 - &H389 for AdLib support (SUPPORTED)
  • SCREEN 12/13, PSET and other drawing stuff (Will be there, through libSDL)

1.4. Features not considered to be supported

These QuickBASIC features are not seen as important, and will not be supported (unless somebody has too much time).
  • All the excessive ERR codes like "String formula too complex" etc
  • KEY ON/KEY OFF (dunno about ON KEY)
  • FIELD and other obscure file features (some of which were new in QB 7.0)
  • COMMON, CHAIN

1.5. Features which are gained for free

1.5.1. Memory allocation

In modern operating systems, the memory allocation is designed so that the user doesn't have to care about it. We don't have to meddle with EMS/XMS or any other kind of perverse system the hardware requires for memory allocation.
So if you want to say DIM area(1048576) AS INTEGER, it's fine!
Things like VARPTR$ and SADD() will have to be adjusted a bit though.

1.5.2. Hardware services

In *nix systems, all the devices have been designed so that you can use them by just opening the appropriate file from /dev directory. For example, if you wanted to record and play with your soundcard, you could do OPEN "/dev/dsp" FOR BINARY AS #1, and that's fine. You read there (record), you write there (play).
Of course this won't work in Windows systems.
Other examples could be floppy disks, frame buffer consoles etc.
This isn't the whole truth. Some devices require you to do ioctls before you can do anything useful. This will be considered.

1.6. Extra features

There are no plans for extra features yet, but internationalizations like UTF-8 support would be nice.

1.6.1. Multitasking

QuickBasic programs are usually designed to take 100% of the CPU time all the time. This badly fits to multitasking environments we nowadays have in modern operating systems.
But history is history, and we have to support it.
But we don't have to limit ourselves to it. Even if we couldn't detect and convert Ti#=TIMER:WHILE TIMER<Ti#+1:WEND style loops to USLEEP 1000000, we could support things like USLEEP and FORK. Just maybe.
See your favourite POSIX manual if you don't know what those functions mean.

The ON PLAY(n) mechanism (and ON KEY(n), and ON TIMER(n), and ON STRIG(n), and ON PEN, and ON COM(n)) could also be implemented as threads. That way, we wouldn't need to prefix each statement with a call to a checking routine as is done by QuicBASIC. (We still need to do that for ON ERROR, though, because of RESUME which may require repeating the same statement.)

2. Copying

qbc has been written by Joel Yliluoma, a.k.a. Bisqwit,
and is distributed under the terms of the General Public License (GPL).

If you utilize qbc or parts of it for any purpose, the author wishes to hear of it (and possibly participate), but it is not mandatory for using this software.

2.1. Documentation

Extensive documentation of the design of this compiler can be found in the source package in the doc/ directory.

3. Requirements

At least these GNU tools are required: flex, gcc, make.
Intel compiler ICC is also required, due to C++0X lambda expressions that are used..
boost::regex and boost::smart_ptr are also required.

4. "I want to start programming"

Then learn programming. It's a slow journey which requires patience and eagerness to learn new things.

If you want to start programming with BASIC, go and see DarkBasic.

5. Downloading

Downloading help

  • Do not download everything - you only need one file (newest version for your platform)!
  • Do not use download accelerators or you will be banned from this server before your download is complete!

Date (Y-md-Hi) acc        Size Name                
2008-0127-0452 r--      180236 qbc-0.5.1.tar.bz2
2008-0127-0452 r--      219353 qbc-0.5.1.tar.gz
2008-0127-0452 r--       16528 patch-qbc-0.5.0-0.5.1.bz2
2008-0127-0452 r--       17292 patch-qbc-0.5.0-0.5.1.gz
2008-0126-2030 r--      176975 qbc-0.5.0.tar.bz2
2008-0126-2030 r--      214984 qbc-0.5.0.tar.gz
2008-0126-2030 r--       50002 patch-qbc-0.4.5-0.5.0.bz2
2008-0126-2030 r--       54068 patch-qbc-0.4.5-0.5.0.gz
2008-0124-1505 r--      145829 qbc-0.4.5.tar.bz2
2008-0124-1505 r--      181985 qbc-0.4.5.tar.gz
2008-0124-1505 r--       50256 patch-qbc-0.4.4-0.4.5.bz2
2008-0124-1505 r--       60158 patch-qbc-0.4.4-0.4.5.gz
2008-0122-1735 r--      136432 qbc-0.4.4.tar.bz2
2008-0122-1735 r--      168426 qbc-0.4.4.tar.gz
2008-0122-1735 r--       49836 patch-qbc-0.4.3-0.4.4.bz2
2008-0122-1735 r--       57630 patch-qbc-0.4.3-0.4.4.gz
2007-0314-0126 r--      100675 qbc-0.4.3.tar.bz2
2007-0314-0126 r--      122547 qbc-0.4.3.tar.gz
2007-0314-0126 r--        8308 patch-qbc-0.4.2-0.4.3.bz2
2007-0314-0126 r--        8189 patch-qbc-0.4.2-0.4.3.gz
2007-0215-0215 r--       98229 qbc-0.4.2.tar.bz2
2007-0215-0215 r--      119154 qbc-0.4.2.tar.gz
2007-0215-0215 r--        5892 patch-qbc-0.4.1-0.4.2.bz2
2007-0215-0215 r--        5810 patch-qbc-0.4.1-0.4.2.gz
2007-0214-2011 r--       97018 qbc-0.4.1.tar.bz2
2007-0214-2011 r--      117838 qbc-0.4.1.tar.gz
2007-0214-2011 r--       10046 patch-qbc-0.4.0-0.4.1.bz2
2007-0214-2011 r--       10302 patch-qbc-0.4.0-0.4.1.gz
2007-0214-0043 r--       95349 qbc-0.4.0.tar.bz2
2007-0214-0043 r--      114740 qbc-0.4.0.tar.gz
2007-0214-0043 r--       24540 patch-qbc-0.3.13-0.4.0.bz2
2007-0214-0043 r--       30107 patch-qbc-0.3.13-0.4.0.gz
2007-0125-0027 r--       93376 qbc-0.3.13.tar.bz2
2007-0125-0027 r--      113308 qbc-0.3.13.tar.gz
2007-0125-0027 r--       25878 patch-qbc-0.3.12-0.3.13.bz2
2007-0125-0027 r--       31150 patch-qbc-0.3.12-0.3.13.gz
2007-0124-0146 r--       11654 patch-qbc-0.3.11-0.3.13.bz2
2007-0124-0146 r--       12760 patch-qbc-0.3.11-0.3.13.gz
2007-0124-0147 r--       88083 qbc-0.3.12.tar.bz2
2007-0124-0147 r--      105469 qbc-0.3.12.tar.gz
2007-0124-0147 r--       12842 patch-qbc-0.3.11-0.3.12.bz2
2007-0124-0147 r--       14097 patch-qbc-0.3.11-0.3.12.gz
2007-0123-0158 r--       83448 qbc-0.3.11.tar.bz2
2007-0123-0158 r--       99228 qbc-0.3.11.tar.gz
2007-0123-0158 r--        5814 patch-qbc-0.3.10-0.3.11.bz2
2007-0123-0158 r--        5804 patch-qbc-0.3.10-0.3.11.gz
2007-0122-1625 r--       82262 qbc-0.3.10.tar.bz2
2007-0122-1625 r--       97672 qbc-0.3.10.tar.gz
2007-0122-1625 r--       12742 patch-qbc-0.3.9-0.3.10.bz2
2007-0122-1625 r--       13655 patch-qbc-0.3.9-0.3.10.gz
2006-1117-0136 r--       79141 qbc-0.3.9.tar.bz2
2006-1117-0136 r--       93867 qbc-0.3.9.tar.gz
2006-1117-0136 r--       19777 patch-qbc-0.3.8-0.3.9.bz2
2006-1117-0136 r--       20562 patch-qbc-0.3.8-0.3.9.gz
2006-1112-0245 r--       68248 qbc-0.3.8.tar.bz2
2006-1112-0245 r--       78076 qbc-0.3.8.tar.gz
2006-1112-0245 r--       10684 patch-qbc-0.3.7-0.3.8.bz2
2006-1112-0245 r--       11632 patch-qbc-0.3.7-0.3.8.gz
2006-1102-1521 r--       65768 qbc-0.3.7.tar.bz2
2006-1102-1521 r--       75003 qbc-0.3.7.tar.gz
2006-1102-1521 r--        4729 patch-qbc-0.3.6-0.3.7.bz2
2006-1102-1521 r--        4785 patch-qbc-0.3.6-0.3.7.gz
2006-1101-0005 r--       65246 qbc-0.3.6.tar.bz2
2006-1101-0005 r--       74239 qbc-0.3.6.tar.gz
2006-1101-0005 r--        4774 patch-qbc-0.3.5-0.3.6.bz2
2006-1101-0005 r--        4801 patch-qbc-0.3.5-0.3.6.gz
2006-1029-0531 r--       64179 qbc-0.3.5.tar.bz2
2006-1029-0531 r--       72893 qbc-0.3.5.tar.gz
2006-1029-0531 r--        8111 patch-qbc-0.3.4-0.3.5.bz2
2006-1029-0531 r--        8331 patch-qbc-0.3.4-0.3.5.gz
2006-1027-0109 r--       61709 qbc-0.3.4.tar.bz2
2006-1027-0109 r--       69802 qbc-0.3.4.tar.gz
2006-1027-0109 r--        6771 patch-qbc-0.3.3-0.3.4.bz2
2006-1027-0109 r--        6915 patch-qbc-0.3.3-0.3.4.gz
2006-1025-2339 r--       59739 qbc-0.3.3.tar.bz2
2006-1025-2339 r--       67374 qbc-0.3.3.tar.gz
2006-1025-2339 r--       16138 patch-qbc-0.3.2-0.3.3.bz2
2006-1025-2339 r--       18473 patch-qbc-0.3.2-0.3.3.gz
2006-1025-1502 r--       58077 qbc-0.3.2.tar.bz2
2006-1025-1502 r--       64966 qbc-0.3.2.tar.gz
2006-1025-1502 r--        3381 patch-qbc-0.3.1-0.3.2.bz2
2006-1025-1502 r--        3332 patch-qbc-0.3.1-0.3.2.gz
2006-1024-1823 r--       58146 qbc-0.3.1.tar.bz2
2006-1024-1823 r--       65066 qbc-0.3.1.tar.gz
2006-1024-1823 r--       33656 patch-qbc-0.3.0-0.3.1.bz2
2006-1024-1823 r--       39143 patch-qbc-0.3.0-0.3.1.gz
2006-1023-1436 r--       44153 qbc-0.3.0.tar.bz2
2006-1023-1436 r--       47543 qbc-0.3.0.tar.gz
2006-1023-1436 r--       36034 patch-qbc-0.2.3-0.3.0.bz2
2006-1023-1436 r--       41007 patch-qbc-0.2.3-0.3.0.gz
2006-1013-2240 r--       31036 qbc-0.2.3.tar.bz2
2006-1013-2240 r--       31872 qbc-0.2.3.tar.gz
2006-1013-2240 r--       13311 patch-qbc-0.2.2-0.2.3.bz2
2006-1013-2240 r--       13474 patch-qbc-0.2.2-0.2.3.gz
2004-1009-1958 r--       26275 qbc-0.2.2.tar.bz2
2004-1009-1958 r--       48553 patch-qbc-0.2.1-0.2.2.bz2
2003-1117-0431 r--       58372 qbc-0.2.1.tar.bz2
2003-1117-0431 r--       65106 patch-qbc-0.2.0-0.2.1.bz2
2003-1117-0333 r--       62101 qbc-0.2.0.tar.bz2
2003-1117-0333 r--       70740 patch-qbc-0.1.1.8-0.2.0.bz2
2003-1117-0333 r--       88751 patch-qbc-0.1.1-0.2.0.bz2
2003-0530-0259 r--       57172 qbc-0.1.1.8.tar.bz2
2003-0530-0259 r--       22912 patch-qbc-0.1.1.7-0.1.1.8.bz2
2003-0206-2140 r--       55990 qbc-0.1.1.7.tar.bz2
2003-0206-2140 r--        1839 patch-qbc-0.1.1.6-0.1.1.7.bz2
2003-0206-2043 r--       55387 qbc-0.1.1.6.tar.bz2
2003-0206-2043 r--        3186 patch-qbc-0.1.1.5-0.1.1.6.bz2
2002-1214-1644 r--       55469 qbc-0.1.1.5.tar.bz2
2002-1214-1644 r--       11430 patch-qbc-0.1.1.4-0.1.1.5.bz2
2002-1020-1257 r--       55560 qbc-0.1.1.4.tar.bz2
2002-1020-1257 r--        5868 patch-qbc-0.1.1.3-0.1.1.4.bz2
2002-0719-1642 r--       53250 qbc-0.1.1.3.tar.bz2
2002-0719-1642 r--        1643 patch-qbc-0.1.1.2-0.1.1.3.bz2
2002-0710-2203 r--       53205 qbc-0.1.1.2.tar.bz2
2002-0710-2203 r--        3804 patch-qbc-0.1.1.1-0.1.1.2.bz2
2002-0514-1755 r--       52559 qbc-0.1.1.1.tar.bz2
2002-0514-1755 r--       11007 patch-qbc-0.1.1-0.1.1.1.bz2
2002-0408-1431 r--       43463 qbc-0.1.1.tar.bz2
2002-0408-1431 r--       39554 patch-qbc-0.1.0-0.1.1.bz2
2002-0330-1611 r--        6013 qbc-0.1.0.tar.bz2
2002-0330-1611 r--       14721 patch-qbc-0.0.2-0.1.0.bz2
2002-0328-2338 r--       16758 qbc-0.0.2.tar.bz2
2002-0328-2338 r--       10421 patch-qbc-0.0.1-0.0.2.bz2
2000-0926-1507 r--       11897 qbc-0.0.1.rar
2000-0926-1507 r--       13472 qbc-0.0.1.tar.bz2
2000-0926-1507 r--       21030 qbc-0.0.1.zip
2000-0926-1507 r--         617 patch-qbc-0.0.0-0.0.1.bz2
2000-0926-1505 r--       11636 qbc-0.0.0.rar
2000-0926-1505 r--       13133 qbc-0.0.0.tar.bz2
2000-0926-1505 r--       21008 qbc-0.0.0.zip
Back to the source directory index at Bisqwit's homepage