Est. 2000 Intermediate

GABasic

GABasic, Gabriel Fernandez's 2000 hobbyist BASIC compiler that turned QuickBASIC-style programs into 32-bit protected-mode DOS executables via NASM and the WDOSX extender.

Created by Gabriel Fernandez

Paradigm Procedural
Typing Static, declared with DIM ... AS LONG/INTEGER/BYTE/STRING or QuickBASIC type suffixes; integer-only (no floating point)
First Appeared 2000 (first public mention May 2000)
Latest Version GABasic 0.30 Beta 2 (Public), with source, c. August 2000

GABasic (also written Gabasic or GaBasic) was a freeware BASIC compiler for MS-DOS written by Gabriel Fernandez and released in 2000. It belonged to the QBasic hobbyist scene of the late 1990s and early 2000s, when many programmers writing games in Microsoft QuickBASIC and QBasic were running into the limits of 16-bit real mode, especially the 64 KB segments and the 640 KB of conventional memory. GABasic offered a way out. It accepted a dialect close to QuickBASIC and compiled it to 32-bit x86 assembly, which the Netwide Assembler (NASM) assembled and Michael Tippach’s WDOSX DOS extender turned into a protected-mode executable that could address all of the machine’s memory.

GABasic never got past version 0.30 and was always labelled beta. It mattered less as a finished product than as a published example of a QBasic programmer building a working compiler, with source included, and as the starting point for its successor, UltraBasic.

History & Origins

The QBasic scene in 2000

By 2000 Microsoft had long since stopped developing QuickBASIC (4.5 was released in 1988, and the Professional Development System 7.1 came in 1990). An active online community was still using it, organised around sites such as Pete’s QB Site and fan magazines such as QB Cult Magazine and The QB Times. Much of that community’s effort went into getting around real mode. People wrote assembly libraries, EMS/XMS memory managers and, increasingly, new compilers that kept QuickBASIC syntax but produced 32-bit code.

Release

The first public mention of GABasic found so far is in the news section of QB Cult Magazine issue 3, dated May 2000:

Gabriel Fernandez has released a very fast, 90% QB compatible compiler that works in pmode!!! It’s called GABASIC and you get get it from http://gab_soft.tripod.com. The compiler still needs a bit of work, but it looks to be the one to watch.

Issue 2 (April 2000) does not mention it, and every GABasic file in the surviving 0.30 package is dated between April and August 2000. The only earlier dates, all 1999, belong to the bundled third-party files: NASM, WDOSX’s STUBIT.EXE and the WDOSX licence. The encyclopedia’s master list gives a year of 1998, but no source found for this page supports a date that early, so this page uses 2000.

The following month, issue 4 (June 2000) printed part 1 of a tutorial by Fernandez called “Coding a Compiler”:

Well, I think you know Gabasic, it is a basic compiler I made in qbasic … I hope this tut is going to leave you ready to create a compiler like (or maybe better) than Gabasic in QB.

The tutorial targeted real mode rather than GABasic’s protected mode, “because this is the mode that everyone knows how it works”, and it assumed the reader already knew assembler. No later part appears in the magazine’s issues 5 to 9. Around the same time, The QB Times issue 8 described GABasic in its project news as an open-source protected-mode compiler that could use all of XMS, EMS and conventional memory, “this means that you can create arrays up to 4gb of size”.

Version history

The whatsnew.txt file in the final public release lists these versions:

VersionChanges recorded in whatsnew.txt
0.20XGET/XPUT file functions; LINE, VGET, VPUT, VSPUT, SETCLIP, SETTRANSCOLOR; SETVECT/GETVECT; INP, SADD, VARPTR, VAL, STR$; better documentation
0.22SEEK and LOF; WDOSX licence file included
0.23SUB support
0.26A file editor; TIMER, UCASE$, LCASE$, COMMAND$, GETEXEPATH$; sequential INPUT/OUTPUT file modes; & as AND in IF; the BYTE array type
0.27A new IDE
0.30 Beta (beta testers only)SELECT CASE, single-line IF, AND/OR in IF, RANDOMIZE, SVGA 640×480 modes, text-mode mouse functions
0.30 Beta 2 (beta testers only)a$ = a$ + b$ finally works, SPACE$, QB-compatible STRING$, a new DIM ... AT address syntax, ClearKeyBuffer
0.30 Beta 2 (Public)“SOURCE INCLUDED !!!”

The file is dated 7 August 2000. Dates for the individual earlier versions are not recorded. The release notes give the homepage as gab_soft.tripod.com, “now at www.master-creating.de/gab" (Master Creating was the site of Merlin, who designed QB Cult Magazine issue 3). The FAQ also mentions an earlier members.xoom.com/gabsoft address.

Abandonment and UltraBasic

The header of the compiler source (Gabasic.bas) says that GABasic would be rewritten as UltraBasic, “a ULTRA powerfull Basic compiler” that would be “95% qb compatible”, and promises it before February 2001. Fernandez did not finish it. The UltraBasic readme of March 2004 says he “abandoned its work in 2000”. Angelo Rosina then picked up the project, and UltraBasic 0.31a (2004) fixed GABasic’s best-known weakness by evaluating expressions with proper operator precedence. It also added floating point and Win32 console executables alongside the WDOSX DOS target. When GeoCities closed in 2009, Rosina moved UltraBasic to SourceForge (registered 21 July 2009). The SourceForge description credits Fernandez as the original author.

Design Philosophy

The bundled manual is clear about who GABasic was for: “you must have experience in qbasic programming.” The aim was not to teach BASIC. It was to let QBasic programmers keep the syntax they knew while escaping its memory model. The manual opens:

Gabasic a basic compatible compiler, created to make powerfull programs. It works in Protected Mode, allowing to use all the computer memory

Because the target was flat 32-bit protected mode, GABasic dropped the segment arithmetic that dominated low-level QuickBASIC code (DEF SEG, segment:offset pairs). The manual tells users to convert real-mode addresses with Address = Segment << 4 + Offset and to PEEK and POKE linear addresses directly. VGA memory, for example, is simply 0A0000h.

Key Features

Toolchain

GABasic did not produce machine code itself. The package’s MAKE.EXE chained three tools:

  1. GABASIC.EXE translated the .bas file into a 32-bit NASM assembly listing, pasting in runtime routines from an INCLUDE directory (string.asm, vga.asm, svga.asm, sprite.asm, file.asm, mouse.asm, dpmi.asm and others).
  2. NASM 0.98, which is bundled, assembled the listing into an RDOFF object (-f oldrdf).
  3. WDOSX’s STUBIT.EXE bound the object to the WDOSX extender stub, which gave a stand-alone DOS executable.

The generated code begins at the WDOSX entry point _WdosxStart in a [BITS 32] section. The compiler itself was written in QuickBASIC-dialect BASIC: the release includes its roughly 88 KB source, Gabasic.bas. A Windows IDE, GABasic Studio v1.00 (GB.EXE), was built with Visual Basic 5 and needed the VB5 runtime and some OCX files, according to the FAQ.

Language

GABasic followed QuickBASIC closely enough that simple programs often only needed small changes:

  • Types: DIM ... AS LONG, INTEGER, BYTE or STRING * n, the QuickBASIC suffixes %, & and $, plus shorthand declarations such as DIML, DIMI and DIMS. There was no floating point; the source header says “Gabasic doesn’t support floating point math(yet)”.
  • Control flow: IF/ELSE/END IF, FOR/NEXT, DO ... LOOP (with the condition only at the top), GOSUB/RETURN, GOTO, SUB, and (from 0.30) SELECT CASE, plus EXIT FOR/DO/SUB.
  • Low-level access: PEEK/POKE in byte, word and doubleword forms (POKEW, POKED), INP/OUT likewise, MEMCOPY/MEMFILL, VARPTR/SADD, SETVECT/GETVECT for installing interrupt handlers, and inline ASM ... END ASM blocks.
  • Graphics: built-in commands for mode 13h (320×200×256): PSET, LINE, BOX, FILLBOX, HLINE, VLINE, SETCOL palette control, SETCLIP, a SETVOFFS command for double buffering, and the sprite commands VGET, VPUT (with a transparent colour) and VSPUT. 0.30 added SVGA 640×480×256 modes.
  • Files: OPEN ... FOR BINARY/INPUT/OUTPUT AS n (with no #, and the file number can be an expression), plus GET/PUT and the extensions XGET/XPUT, which read or write straight to a memory address.

Departures from QuickBASIC

GABasic’s syntax had some quirks of its own:

  • C-style compound assignment: a =+ 1, a =- 1, and a$ =+ CHR$(1) for string appends.
  • & and | instead of AND and OR in conditions. The manual of June 2000 says OR is not supported at all, while the 0.30 notes add AND/OR but still recommend & and |.
  • ; accepted as a comment character alongside '.
  • Strings stored with a 4-byte length prefix, which matters if you poke into them.
  • No operator precedence. The compiler-sources archive at exmortis.narod.ru notes that GABasic “was intended to be QuickBasic compatible but failed, there are no operation precedence!” UltraBasic later fixed this.

Example

This is the demonstration program shipped as Examples/example.bas. Its comments show where GABasic and QBasic syntax differed:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
CLS

PRINT "Screen 13"
PRINT "Check this program in qb and in GABasic"
PRINT "to compare the speed"

FOR i = 20 TO 10 STEP -1
  COLOR i - 5
  PRINT "For/next example"
NEXT

c = 0
times = 2

SLEEP

SCREEN 13

DO WHILE NOT c > times
 c = c + 1

 FOR y = 0 TO 199
   FOR x = 0 TO 319
     pset x, y, c ' For gbasic
     '  PSET (x, y), c' for qbasic
   NEXT x
 NEXT

SLEEP   ' The samething that waitkey, gbasic support sleep

LOOP

SCREEN 0

END

The program invites users to compare speed against QuickBASIC, but the package publishes no timing figures, and none were found in contemporary coverage. QB Cult Magazine’s “very fast” was a news-column impression, not a benchmark.

Current Relevance

GABasic is long dead. The Tripod, Xoom and master-creating.de homepages have gone, and Fernandez’s last known work on the line was in 2000. The 0.30 Beta 2 package, with its source, survives in the Russian compiler-sources collection at exmortis.narod.ru. That collection also carries UltraBasic 0.31a. UltraBasic itself is on SourceForge, listed for MS-DOS and Windows. According to the project description, its source is in QuickBASIC PDS 7.

The compiler and the programs it generates are DOS executables, so running them today would need a DOS environment or emulator. Neither was tested for this page. There is no Docker image.

Why It Matters

GABasic is a small but typical artefact of the period when the QBasic community tried to modernise its own language from the bottom up. It was one of several hobbyist compilers that kept QuickBASIC syntax but replaced Microsoft’s toolchain, alongside MoonRock Basic (16-bit, 1994-1998) and Blunt Axe Basic (Win32 console, 2001-2004), and before the much more successful FreeBASIC. GABasic’s way of doing it was notably low-tech. It was a compiler written in QBasic itself that emitted NASM text and borrowed a freeware DOS extender, and it shipped with source and a magazine tutorial. That made it as much a teaching example as a product. Its direct line ended with UltraBasic, but it shows how far an individual QBasic programmer could get in 2000 using only freely available tools.

Timeline

2000
QB Cult Magazine issue 3 (May 2000) reports that Gabriel Fernandez has released GABASIC, "a very fast, 90% QB compatible compiler that works in pmode", downloadable from gab_soft.tripod.com. This is the earliest public mention found; issue 2 (April 2000) does not mention it
2000
QB Cult Magazine issue 4 (June 2000) prints part 1 of Fernandez's "Coding a Compiler" tutorial, which uses GABasic as its reference point. No later part appears in issues 5 to 9 (July 2000 to February 2001)
2000
The QB Times issue 8 (mid-2000) describes GABasic in its project news as an open source protected-mode BASIC compiler that can use all of XMS, EMS and conventional memory, with arrays of up to 4 GB
2000
GABasic 0.30 Beta 2 (Public) is released with the compiler's own source code. Its whatsnew.txt is dated 7 August 2000 and lists versions 0.20, 0.22, 0.23, 0.26, 0.27 and two 0.30 beta-tester builds before it. The source announces a rewrite called UltraBasic
2004
UltraBasic 0.31a, the successor Fernandez abandoned in 2000, is released by Angelo Rosina (readme dated 14 March 2004). It adds operator precedence, floating point and Win32 console output
2009
With GeoCities closing, UltraBasic moves to SourceForge (project registered 21 July 2009), where its description still credits Gabriel Fernandez as the original author

Notable Uses & Legacy

QB Cult Magazine compiler tutorial

Fernandez used GABasic as the worked example behind his "Coding a Compiler" series in QB Cult Magazine (June 2000), which taught QBasic programmers how to write a BASIC-to-assembly compiler in QBasic itself

Protected-mode graphics demos

The release ships example programs for VGA mode 13h graphics, sprites (VGET/VPUT), PCX loading, mouse input and direct video-memory arrays. They show the kind of fast DOS graphics code the QBasic game scene of the time wanted from a 32-bit compiler

Foundation for UltraBasic

GABasic was the base for UltraBasic, which Angelo Rosina carried on until 2004. UltraBasic added DOS (WDOSX) and Win32 console targets, and its source is still on SourceForge

Language Influence

Influenced By

QuickBASIC

Influenced

UltraBasic

Running Today

Run examples using the official Docker image:

docker pull
Last updated: