GBasic
GBASIC, Gianni Becattini's Z80 BASIC interpreter from Florence: introduced in 1983 as the graphics BASIC of the G5 kit computer, it later became a ROM-resident operating system and interpreter for industrial controllers.
Created by Gianni Becattini
GBASIC (catalogued here as GBasic) is a BASIC interpreter for Zilog Z80 processors written by Gianni Becattini, an engineer in Florence, Italy. It first appeared in 1983 as the built-in language of the G5, a home-built microcomputer Becattini published as a construction project in the Italian electronics magazine CQ Elettronica. The “G” stood for grafico (graphics): the original GBASIC was written to exploit a video chip that was popular at the time, and it had commands for line drawing and moving sprites.
GBASIC’s later history is unusual for a hobbyist BASIC. Instead of fading out with its home computer, it moved into industrial automation and process control. By the 1990s it had become a ROM-resident operating system and interpreter for Z80 controller boards, with a driver model, interrupt handling, a PC-side precompiler and a windowed development environment. Becattini wrote in 1993 that it had “given its best” in that field.
Not to be confused with several other products called GBASIC or Graphics BASIC: Microsoft’s GBASIC, the hi-res graphics version of MBASIC supplied with the Apple II SoftCard; North Star’s Graphics BASIC for the Advantage; the G-BASIC extension for MSX V9990 video cards; and Microsoft’s GW-BASIC. This page covers Becattini’s Z80 interpreter, which is the only one of these that matches the 1983 date.
History & Origins
The G5 and CQ Elettronica
CQ Elettronica, published in Bologna by Edizioni CD, was a long-running Italian magazine for radio amateurs and electronics hobbyists. Becattini also wrote for it on radio topics (the January 1983 issue carries a radio article by him as well). In issue 1/83 he introduced the G5 microcomputer, and the construction article concluded in 2/83.
The G5’s published specification was:
| Feature | G5 (CQ Elettronica, 1983) |
|---|---|
| CPU | Z-80, clocked at 2.5 MHz (derived from the video clock divided by four) |
| ROM | 16 KB in two 2564 EPROMs, containing the base software and GBASIC |
| Program memory | 1–4 KB of battery-backed CMOS RAM, expandable to 48 KB |
| Video | a 9929 video processor with 16 KB of dedicated RAM (eight 4116 chips) |
| Graphics | 256 × 192 points; 24-line text mode; 32 sprites |
| Input | any ASCII keyboard, read through a Z-80 PIO under interrupt |
Becattini’s main design goal was that anyone who built the kit would end up with a working machine. Holding programs in battery-backed RAM meant the G5 did not depend on an unreliable cassette interface for everyday use. Once assembled, the machine was tested by pressing RESET and waiting for the banner:
GBASIC Vers. 1/5/82 - Copyright ing. Gianni Becattini - Firenze.
The article then told readers to type PRINT 1/2 and check that the answer 0.5 appeared.
The 1983 book
The G5 had no manual of its own. Instead, Becattini wrote Il computer è facile, programmiamolo insieme (“The computer is easy, let’s program it together”), a beginners’ book published by Edizioni CD as a supplement to CQ Elettronica and printed in April 1983. It teaches BASIC from scratch using GBASIC and the G5, with chapters on loops, subroutines, arrays, elementary graphics, animation, functions and the printer, and it ends with a complete reference to the language. The book states that GBASIC and G5 were the author’s trademarks.
The 1983 Language
The reference chapter of the 1983 book describes a small, conventional, line-numbered BASIC:
- Numbers were floating point with 6 significant digits and an exponent range of about 10−128 to 10127.
- Line numbers ran from 1 to 65535. Programs were edited in the classic way: typing a numbered line inserts or replaces it, and typing the number alone deletes it.
- Variable names were a letter or a letter followed by one digit, giving 286 scalar names and 286 array names. Arrays were dimensioned automatically to 10 (11 elements, since index 0 exists) unless
DIMsaid otherwise. - Upper case only. Apart from text inside quotes in
PRINT,LPRINTandINPUT, programs had to be written in capitals, or GBASIC reported a “language error”. - Graphics were the reason for the “G”.
GRAPHandTEXTswitched modes,PLOT x1,y1,x2,y2drew a line segment andUNPLOTerased one, andORGmoved the origin. Coordinates could address a 256 × 256 plane, of which the lower 256 × 192 was visible. - Sprites were handled by statements such as
SPTYP(sprite type),SPCOL(sprite colour) andSPMOV(move a sprite). - Hardware access used
OUTto the G5’s I/O ports, and statements needing machine-code knowledge were marked “E+” for experts.
A bouncing-ball program from the book’s animation chapter shows the style. Comments are translated from Italian; some comment lines and the sprite-shape subroutine at line 1000 are omitted:
| |
Evolution: From Home Computer to Controller
Becattini’s 1993 preface describes the change in GBASIC’s purpose: born to drive a graphics chip, it went on to do its best work in industrial automation and process control on Z80-based hardware. By version 7 GBASIC was no longer just an interpreter but a small development system:
- A ROM-resident operating system on the target board, split since version 7 into a hardware-independent kernel and modular drivers for specific peripherals. Kernel and drivers communicate without shared addresses, so no link step is needed, and users can write drivers for their own hardware without the GBASIC source. The October 1990 manual (for version 7.35) calls this the most drastic change between versions in GBASIC’s history.
- The GBASIC interpreter itself, also in ROM, which runs programs typed at a terminal or stored in ROM.
- PREGB, a precompiler run on a PC. It turns “extended GBASIC” source files (
.GBE), written in a freer syntax, into the line-numbered form the ROM interpreter executes. It supports local variables (though not recursion), and PREGB version 2 always emits a symbol file that GBT loads. - GBT, a windowed integrated development environment for the PC. It edits, precompiles, sends programs to the target over RS-232 as text or as an Intel HEX memory image, and lets the programmer inspect symbols while the program runs.
- MMT, a “mini multi task” executive mainly intended for drivers that need a background process, such as a print spooler.
Version 7.40 also raised numeric precision to 10 significant digits and supported two memory layouts: 32 KB of EPROM with either 8 KB or 16 KB of RAM, detected automatically at power-up.
Extended GBASIC
Extended source looks quite different from the 1983 dialect. It has declaration blocks, named labels instead of line numbers, lower-case keywords and driver channels. This example is from Studio IGB’s 1997 set for the M4 Plus board. It blinks the user LED by writing to a serial controller register, with comments translated:
| |
(The printed messages are reproduced as they appear in the original source, where “off” accompanies the write that the comment says turns the LED on.)
Other examples in the same set show the control-oriented features. Drivers are opened as channels (open ch 4,"CCAL:","D 128" for the calendar clock, open ch 5,"LCD1:" for a display) and can be bound to built-ins such as time$ and date$. Hardware counters can trigger BASIC interrupt handlers:
| |
Design Philosophy
GBASIC’s two lives share one idea: BASIC’s ease of use is worth keeping even on hardware where it is not normally offered. In 1983 that meant giving hobbyists who built their own computer a BASIC with graphics and sprites, plus non-volatile program memory so the machine was usable without fiddly storage. In the 1990s it meant giving control engineers an interpreted, interactive language on bare Z80 boards. The 7.40 manual says GBASIC keeps “the simplicity of use and speed of development common to standard BASIC” while adding things that “business” interpreters lacked: complex interrupt management and easy links to assembly language through drivers. It also argues for an interpreter during development, because the programmer can interact with the running program directly.
Current Relevance
GBASIC is historical. The latest dated materials found are the 7.40/7.41 manual of October 1993, update bulletins with file dates of September and December 1997, and a manual revision file dated December 1998. No later releases are known. The software is not dormant in the sense of being lost, though. In 2019 the 7.40 manual, the interpreter sources, the GBT environment with its example programs, and the schematics, PCB files and manuals for the Studio IGB M4 Plus and M5 controllers were placed on the Internet Archive under Becattini’s name, with a 2019 note on how to rebuild the sources. The 1983 book and the relevant CQ Elettronica issues are on the Internet Archive too.
There is no maintained emulator or container image for GBASIC. Running it today means rebuilding the ROM from the archived sources for real or emulated Z80 hardware.
Why It Matters
- A record of Italian home-computer culture. In the early 1980s, many European enthusiasts built computers from magazine articles rather than buying them. The G5 and its GBASIC are a well-documented Italian example, with the magazine articles, the book and the boot banner all surviving.
- An unusual career path for a BASIC. Most home-computer BASICs died with their machines. GBASIC was redesigned around a kernel and driver model and spent roughly a decade, on the dated evidence of its manuals and example files (about 1990 to 1997–98), running embedded control applications. Its 1993 preface says it allowed “dozens of applications” to be built.
- An unusually complete archive. Few small commercial interpreters from this period have their manuals, sources, development tools, example programs and target-board designs all publicly available. GBASIC’s archive makes it possible to study how a one-person Z80 BASIC grew into an embedded development system.
Sources
- G. Becattini, “G5 – microcomputer”, CQ Elettronica 1/83, p. 78, and 2/83, p. 111 (Edizioni CD, Bologna), on the Internet Archive as
CQ_elettronica_1983_01andCQ_elettronica_1983_02. An Edizioni CD advertisement for the book in CQ Elettronica 5/83 refers to the G5 article “in CQ n. 1 e 2/1983”. - G. Becattini, Il computer è facile, programmiamolo insieme, Edizioni CD, 1983 (printed April 1983), Internet Archive
ilcomputerefacileprogrammiamoloinsieme. - G. Becattini, GBASIC 7.40 – Manuale Generale, Florence, October 1993, with the archived sources, IDE, example programs and controller files, Internet Archive
gbasicz80.
Timeline
Notable Uses & Legacy
G5 home-built microcomputer
GBASIC was the built-in language of the G5, a Z-80 kit computer Becattini published in CQ Elettronica in 1983. Readers wired the two circuit boards themselves and got GBASIC in two 2564 EPROMs as the machine's whole software environment
Il computer è facile, programmiamolo insieme (1983)
Becattini's beginners' book on BASIC programming, published by Edizioni CD as a supplement to CQ Elettronica, used GBASIC for all of its examples, including its chapters on graphics and sprite animation
Studio IGB M4 Plus and M5 controllers
Z80-based controller boards from Studio IGB of Florence were programmed in GBASIC. The 1997 example set drives LEDs, LCDs, a real-time clock, analogue inputs, serial links and hardware counters with interrupt handlers. The archived M5 package includes a GBASIC ROM image