• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
Retro Game Coders

Retro Game Coders

Retro computer/console game + dev community

  • About
    • Retro Computer Collection
    • Contact
  • Blog
  • Retro Resources
    • Retro Gaming Timeline
    • Online Retro IDE
    • Retro Pixel Art Editor
    • Dungeon Loom Map Editor
    • 6502 Programmer’s Reference
    • Emulators
      • Acorn Electron
      • Amstrad CPC Emulator
      • Online BBC Micro Emulator
      • Commodore PET Emulator
      • Browser C64 Emulator
      • DOSBox/DOS PC emulator
      • Tandy CoCo/Dragon
    • Best Retro YouTube Channels
    • New Retro Books
    • Raspberry Pi Amiga Emulation
    • MiSTer FPGA Tutorial
    • BMC64 C64 Pi
  • Community

Home » Retro Game Coders Blog » Programming

Compiled ZX Spectrum BASIC and Z88DK Added to Online Retro IDE

ZX BASIC

Join Retro Game Coders Community
Join the Retro Game Coders Community

ZX BASIC (AKA Boriel BASIC) is now available on my retro programming IDE!

This allows not just classic ZX Spectrum BASIC programming, but it is a compiler with some modern features (labels, inline Z80 assembler, no need for line numbers, etc) so your Speccy games will run faster too.

It outputs your compiled C or BASIC programs as .Tap files which allow you to run your compiled program on most emulators and real hardware via Tapduino/Maxduino or converting to .WAV audio files.

This was high on my list of priorities as the grey Spectrum +2 was my second computer after the Vic 20. Sadly the one I owned was gifted away a long time ago so I had to fleabay a broken one (I also have a working later model +2 now).

My Stunt Speccy 128+2
My Stunt Speccy 128+2

Figuring out how to add server-based assembler using Kickass Assembler on that system was the knowledge I needed to add C compilation via Z88DK and ZX BASIC compiler too.

(I’d love to add ZX Spectrum Next platform to the system but as yet I don’t know of a browser-based emulator.)

You can now follow the tutorials and edit the code right in your web browser with the Online Retro IDE

– No downloads, configuration, etc necessary, and it is free!

Hello World Example

As usual you can do the standard “Hello World”:

10 REM Hello World for ZX Spectrum
20 PRINT "Hello, World!"
30 PRINT "ZX Spectrum BASIC!"
40 GO TO 20

But you do not need to use line numbers, as you can see below:

REM Sample circle drawing

DIM i, r, x, y, q as Float
DIM ax, ay, zx, zy, dx, dy as Ubyte

x = 127
y = 87
r = 40
q = 1 / r

FOR i = 0 TO PI/2 STEP q
	dy = SIN(i) * r
	dx = COS(i) * r

	zx = x - dx
	zy = y - dy
	ax = x + dx
	ay = y + dy

	PLOT ax, ay
	PLOT zx, ay
	PLOT ax, zy 
	PLOT zx, zy

NEXT i

You will also notice the variable types (Float and Ubyte)

Finally, you can have subroutines and functions, plus inline assembly/data:

graphicsbank:
ASM
    DEFB 060,126,219,255,255,255,219,219
END ASM

FUNCTION FUN(NUM as FLOAT)

   return NUM+1

END FUNCTION


SUB hello ()
   CLS
   POKE UINTEGER 23675, @graphicsbank
   PRINT CHR$(CODE "\a")	
   PRINT "Hello World!",FUN(1)

END SUB

hello()

This defines a user defined character using inline assembly, and via a subroutine outputs it using it’s character code. Then it calls a function which increments the passed-in number.

Example ZX BASIC program output
Example BASIC program output

Try it out and let me know what you think in the Retro Game Coders community forum!

Category: ProgrammingTag: basic programming, zxspectrum
Previous Post:MAXduino reviewMaxduino Review: Tape Cassette Emulator for Multiple Retro Computers
Next Post:XBerry Pi Review – ZX Spectrum Next in Pi Form FactorXBerry Pi Review

Retro Game Coders

Retro computer/console game + dev programming community by Chris Garrett

  • Bluesky
  • Threads
  • Facebook
  • Instagram
  • YouTube
  • Mastodon

Maker Hacks ・ D6Combat・chrisg.com

© Copyright 2026 Chris Garrett

Privacy ﹒ Terms of Service

Return to top