Est. 1983 Beginner

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

Paradigm Procedural
Typing Dynamic, untyped numeric variables (floating point: 6 significant digits in 1983, 10 in version 7.40)
First Appeared 1983 (CQ Elettronica 1/83; ROM banner dated 1/5/82)
Latest Version GBASIC 7.40/7.41 (manual dated October 1993; update notes to 1997)

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:

FeatureG5 (CQ Elettronica, 1983)
CPUZ-80, clocked at 2.5 MHz (derived from the video clock divided by four)
ROM16 KB in two 2564 EPROMs, containing the base software and GBASIC
Program memory1–4 KB of battery-backed CMOS RAM, expandable to 48 KB
Videoa 9929 video processor with 16 KB of dedicated RAM (eight 4116 chips)
Graphics256 × 192 points; 24-line text mode; 32 sprites
Inputany 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 DIM said otherwise.
  • Upper case only. Apart from text inside quotes in PRINT, LPRINT and INPUT, programs had to be written in capitals, or GBASIC reported a “language error”.
  • Graphics were the reason for the “G”. GRAPH and TEXT switched modes, PLOT x1,y1,x2,y2 drew a line segment and UNPLOT erased one, and ORG moved 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) and SPMOV (move a sprite).
  • Hardware access used OUT to 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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
10 REM BALL PROGRAM
20 GRAPH
30 REM ONE SPRITE, TYPE 0,0
40 SPTYP 0,0,1
45 SPCOL 0,15
60 GOSUB 1000
80 LET K=1
84 LET Y=128
90 LET Y=Y-K
100 SPMOV 0,100,Y
110 IF Y<1 THEN LET K=-K
120 IF Y>127 THEN LET K=-K
130 GOTO 90
140 END

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:

 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
#DECLCONST
	SIOAC	 = _105
#END

#DECLVAR
	i,n
#END

#CODE
'	the first statement must be a REM to use program autostart
	rem "autostart"

#-> Loop
'	turn the LED on
	out SIOAC, 5
	out SIOAC, 234
	print "LED off"
	gosub Delay

'	turn the LED off
	out SIOAC, 5
	out SIOAC, 106
	print "LED on"
	gosub Delay
	goto Loop

#-> Delay
	for n=1 to 1000
	next
	return
#END

(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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
	reset interrupt clear
	open counter 1,"C 3 D 103"
	on counter 1 gosub CntrIsr
	reset counter 1
	counter 1,1
	interrupt 1
	load counter 1 with 10
	...
#-> CntrIsr
	print "Arrivato"
	load counter 1 with 10
	return counter 1

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_01 and CQ_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

1982
The G5's ROM is built with the boot banner "GBASIC Vers. 1/5/82 - Copyright ing. Gianni Becattini - Firenze", as quoted in the February 1983 construction article. In Italian date order this most likely means 1 May 1982, but the article does not say so
1983
CQ Elettronica 1/83 (January 1983) introduces Becattini's G5 microcomputer, a home-built Z-80 kit with GBASIC in 16 KB of ROM, 256 x 192 graphics and 32 sprites
1983
CQ Elettronica 2/83 (February 1983) concludes the G5 construction article: a Z-80 at 2.5 MHz, a 9929 video processor with 16 KB of its own RAM, and battery-backed CMOS memory for programs. The article says it "continues from the last issue and ends in this one"
1983
Edizioni CD of Bologna publishes Becattini's book Il computer è facile, programmiamolo insieme as a supplement to CQ Elettronica. It was printed in April 1983, teaches BASIC using GBASIC on the G5, and served as the G5's manual
1990
The October 1990 manual edition for version 7.35 (Florence), whose preface is reprinted in the 7.40 manual, describes the biggest redesign in the interpreter's history: a hardware-independent kernel plus separately written device drivers, so that users can port it to their own Z80 hardware without the source
1993
The GBASIC 7.40 general manual is dated October 1993. Its preface notes that GBASIC is ten years old that year and has "given its best" in industrial automation and process control
1997
Example programs copyrighted by Studio IGB of Florence (dated May to October 1997) target the M4 Plus controller board, and the archived GBASIC update bulletins no. 1 and no. 2 carry file dates of September and December 1997
2019
The GBASIC 7.40 manual, sources, development environment and controller board files are published on the Internet Archive in September 2019 under Becattini's name, with the manual marked for free reproduction and free use

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

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull
Last updated: