QUANTUM BASIC 7.1 · VERSION 1.1.38
Quantum Basic logo

Quantum Basic 7.1

Professional Development System v1.1.38

A QuickBASIC / PDS 7.1 compatible compiler for 64-bit Windows. Write BASIC the way you always have, and get a native x64 program out the other end. Old programs that poke video memory or call DOS interrupts keep working, and many QB64 extensions work too. The IDE has a PDS-style debugger: step through your program a statement at a time, stop at breakpoints and watch your variables change.

▼ Download Quantum Basic 7.1

QuantumBASIC.zip · Version 1.1.38 · Windows 64-bit

Downloaded before November 5, 2026? Download the full zip again once. Earlier copies don't have the automatic updater, so they can't update themselves to 1.1.38.

Downloaded on or after November 5, 2026? In the IDE choose Help > Check for Updates to get new versions without downloading everything again.

Contact Us

Questions, problems or ideas? Send us an email and we'll answer you.

Visitors------
Downloads------
Updates------

Screenshots

Click a picture to see it full size. Use the arrow keys to go through them.

The Quantum Basic IDE editing a program, with keywords, numbers and strings in colour
The editor. QuickBASIC-style, with colour syntax, line numbers, block markers and the Immediate window.
The debugger stopped at line 31, with a breakpoint on line 29 and the watch pane showing i and frame
The debugger. Stopped at line 31. Line 29 has a breakpoint (red). The watch pane at the top shows i and frame as the program runs.
The IntelliSense list showing _SNDBAL, _SNDCLOSE, _SNDCOPY and more after typing _SND
IntelliSense. Start typing a keyword and pick it from the list.
The help screen for CIRCLE: syntax, description, an example and See Also links
Built-in help. F1 on a keyword opens its page: syntax, description, an example you can copy and links to related keywords.
The SUBs dialog listing DEMO.BAS, SUB DrawStars and SUB MoveBall with their line numbers
The SUBs list. F2 lists every SUB and FUNCTION in the program. Pick one to jump to it.
The demo program running: bouncing coloured balls over a starfield in SCREEN 12
The result. The same program compiled to a Windows .EXE and running.

The menus

QuantumNES — a NES emulator written in Quantum Basic NEW

QuantumNES is a complete NES emulator in one BASIC source file, about 2,000 lines. It shows what Quantum Basic can do: a 6502 CPU, the picture and sound chips, bank-switching cartridges, a splash screen and menus you can use with the keyboard or the mouse, all compiled to a native Windows program that runs games at a full 60 frames a second.

  • Plays .nes game files: mappers 0 (NROM), 1 (MMC1), 2 (UxROM), 3 (CNROM), 4 (MMC3), 7 (AxROM), 11, 34, 66 and 71
  • Sound: both pulse channels, triangle and noise
  • Battery saves, a recent games list, pause, reset and full screen
  • Keys: arrows = D-pad, X = A, Z = B, Enter = Start, Space = Select, Esc = menu

No games are included. Use your own .nes files. The pictures here show free homebrew games.

▼ Download QuantumNES.bas

QuantumNES.bas · BASIC source · Version 1.0

Needs Quantum Basic 7.1 version 1.1.27 or later. Earlier versions can't compile or run it correctly. In the IDE choose Help > Check for Updates first, or download the full zip at the top of this page.

To use it: open QuantumNES.bas in the IDE and press F5, or press F11 to make QuantumNES.exe. Then choose Open a Game.

The QuantumNES splash screen: the logo over a starfield, a game pad and PRESS ENTER
The splash screen. Drawn by the BASIC program itself.
The QuantumNES main menu: Open a Game, Recent Games, Controls and Quit
The main menu. Open a game, pick a recent one, or see the controls.
The homebrew shooter BladeBuster running in QuantumNES
A game running. BladeBuster, a homebrew shooter on the MMC3 mapper, with a scrolling playfield and a fixed status bar.
The Sayoonara! demo running in QuantumNES
Split-screen scrolling. The Sayoonara! demo changes the scroll position part-way down the picture.
A homebrew 15 puzzle running in QuantumNES
A puzzle game. A homebrew 15 puzzle.
The QuantumNES menu over a paused game: Resume, Reset Game, Open Another Game, Full Screen, Controls, Main Menu and Quit
The in-game menu. Esc pauses the game: resume, reset, open another game, sound, full screen.

What's new since 1.1.2

Debugger NEW 1.1.8

  • F8 Step runs one statement at a time
  • F10 Procedure Step runs a SUB or FUNCTION call as one step
  • F9 sets a breakpoint; the line turns red and the program stops there. Breakpoints stay on their line as you add or delete lines above them
  • F7 runs to the line the cursor is on
  • F5 continues, Shift+F5 starts the program again
  • Ctrl+Break stops a running program, from the IDE or from the program's own window
  • Watches: Shift+F9 or Debug > Add Watch shows up to 8 variables above the editor, including TYPE fields such as Rec.Name
  • While stopped, PRINT X in the Immediate window shows the value of X in the running program
  • Works in every module of a multi-module (.MAK) program

Editor and IDE

  • Every block closes itself: press Enter after IF ... THEN, FOR, DO, WHILE, SELECT CASE, TYPE or DECLARE LIBRARY and the editor adds the END IF, NEXT, LOOP, WEND, END SELECT, END TYPE or END DECLARE NEW 1.1.17
  • Auto Spacing formats each line as you leave it, like QB64: a=5 becomes a = 5 and PRINT a,b;c becomes PRINT a, b; c. Strings, comments and DATA are left alone NEW 1.1.16
  • Type SUB Name or FUNCTION Name and press Enter, and the editor adds the END SUB or END FUNCTION for you NEW 1.1.15
  • Options > Allow Computer Sleep: on, Windows can put the computer to sleep while the IDE is open; off, the IDE keeps it awake (the monitor can still turn off) NEW 1.1.14
  • A new program icon, and the splash screen is now built into qb71ide.exe, so it shows whichever folder the IDE is started from NEW 1.1.9
  • Error highlighting: lines with errors get a red line number and a wavy red underline, and the status line shows the error when the cursor is on the line
  • Check for Updates (Help menu) downloads only the files that changed, checks each one, and keeps a backup of the old ones. It can also check each time the IDE starts (Options menu)
  • Options > Allow Screen Saver lets the Windows screen saver start while the IDE is open
  • The Options menu stays open while you switch settings on and off
  • Accented file names, such as oñfiletest.bas, show correctly in the title bar, the editor frame and the file lists
  • The F10 key is now Procedure Step, as in PDS 7.1. Alt selects the menu bar

Language

  • $INCLUDEONCE: an include file that is included twice is only read once
  • $USELIBRARY for programs written for other BASIC compilers
  • ON ERROR _NEWHANDLER and ON ERROR _LASTHANDLER: error handlers that stack, so a SUB can set its own handler and then put the previous one back
  • DIM [SHARED] AS type a, b, c and REDIM AS type, declaring several variables of one type at once
  • $ERRORLOCATION is accepted

Graphics and files

  • Programs you compile now also start on 64-bit Windows XP. Before, they stopped at once with "entry point fopen_s not found" NEW 1.1.10
  • _LOADIMAGE loads SVG drawings as well as BMP, PNG, JPG and GIF
  • _LOADIMAGE with extra arguments, including images loaded from memory
  • File and folder names with accented or other non-English letters work in the compiler and in your programs

Fixes

  • A FIELD string now has the right length in every module of a multi-module program. In a program built from several .BAS files, a FIELD variable used in a module other than the one with the FIELD statement had a garbage length, so MID$(a$, n) = fieldvar$ copied nothing and, for example, the DHPOS report programs printed the previous record's data for every item. MID$, UCASE$, LCASE$, PRINT and the string functions now all see the FIELD width NEW 1.1.28
  • STATIC variables follow DEFLNG and the other DEF types, the type suffix and AS type, as in QB (they were all INTEGER) NEW 1.1.27
  • GET #f, , text$ in BINARY mode reads exactly LEN(text$) bytes, as in QB (it read to the end of the file) NEW 1.1.26
  • _LIMIT keeps an exact rate: _LIMIT 60 is 60 frames a second NEW 1.1.26
  • PSET and the other drawing on a _NEWIMAGE image is several times faster NEW 1.1.26
  • An _UNSIGNED _INTEGER64 given a number of 2^63 or more (b = 10000000000000000000) now holds it instead of 9223372036854775808 NEW 1.1.25
  • _CONSOLE OFF and _CONSOLE ON hide and show the $CONSOLE window NEW 1.1.24
  • QB64 ASC(text$, position) = code statement changes one character of a string in place NEW 1.1.23
  • $FORCELPRINT at the top of a program makes LPRINT and OPEN "LPT1:" print on the printer installed on that LPT port, as QBX 7.1 did, instead of the Windows default printer NEW 1.1.22
  • _FORCE$ "LPT1", "DEFAULT" or a printer's name sends LPRINT to that Windows printer ("RESTORE" and "OFF" go back). It prints on any printer, Microsoft Print to PDF too. New QBPrinter.dll for printer lists, status and documents NEW 1.1.21
  • LPRINT output now prints when the program ends, LPRINT TAB(n) goes to column n, a comma goes to the next print zone, and LPRINT USING numbers go to the printer, not the screen NEW 1.1.21
  • A C DLL function that returns a string now gives the right text NEW 1.1.21
  • A DLL written in C or another language, next to your program, now links: DECLARE FUNCTION F& LIB "MYDLL" () and DECLARE LIBRARY "MYDLL" blocks. Before, the link failed with "library not found" even with the DLL in the folder. The DLL is copied next to the .EXE NEW 1.1.20
  • A TYPE can now hold another TYPE (Ship AS SHIP, then Player(1).Ship.rect.x1). Copying, passing to a SUB or FUNCTION and reading these fields works. Before, every such field read as 0, so games like QB64 Space Invaders showed a blank screen NEW 1.1.19
  • SLEEP and "Press any key to continue" now wait for a new key press. Before, one key press could end several SLEEPs and the end-of-program prompt at once, and the window closed NEW 1.1.18
  • The computer can go to sleep while the IDE is open. With Allow Screen Saver switched off, the IDE used to keep the whole PC awake NEW 1.1.13
  • PRINT TAB(n) now moves to column n, on the screen and in files, so tables line up. Before, it printed n spaces, like SPC(n) NEW 1.1.12
  • Inside a DECLARE LIBRARY block, lines written as DECLARE FUNCTION ... or DECLARE SUB ... now work, the same as FUNCTION .... Before, they were skipped and the functions returned 0 or "" NEW 1.1.11
  • Programs with many FIELD statements no longer crash
  • An unclosed block at the end of a program (a FOR without NEXT) is reported on the last line as "found end of file", not on line 1
  • The compiler checks that the runtime library is the same version as itself, so a half-finished update can't build programs with old fixes missing

Compiler

  • New -g option makes a debug build. The IDE uses it for debugging; F11 Make EXE always makes a normal program
  • qb71 -h lists all the options

The debugger at a glance

SHOW Sq%: 4
SHOW Total&: 1
6 FOR I% = 1 TO 3
7 Show I%
8 NEXT I%
9 PRINT "done"; Total&
10 END
11
12 SUB Show (N%)
13♦ Sq% = N% * N%
14► Total& = Total& + Sq%
15 PRINT N%, Sq%
16 END SUB
Stopped at line 14 in SHOW │ <F5=Continue> <F8=Step> <F10=Procedure Step>

The red line is a breakpoint and the teal line is the statement about to run. The watches above the editor show the variables of the SUB the program stopped in.

KeyDoes
F8Step: run one statement. If the program isn't running, start it and stop before the first statement
F10Procedure Step: like F8, but a SUB or FUNCTION call runs as one step
F9Toggle Breakpoint on the cursor line
F7Run to Cursor
F5Continue (or run, when no program is running)
Shift+F5Start the program again from the beginning
Shift+F9Instant Watch: watch the variable under the cursor
Ctrl+BreakStop the running program where it is

The Debug menu also has Add Watch, Delete Watch, Delete All Watches, Clear All Breakpoints and Stop Debugging.

Tip: pressing F5 with no breakpoints set runs your program at full speed, exactly as before.

What it does

How it works

Quantum Basic is a real compiler, not an interpreter. Your program goes through the same stages as a C compiler and ends up as x64 machine code, linked against the Quantum Basic runtime library.

The runtime library (librt.a) is where the BASIC statements actually do their work. Two of its parts are written specially for Quantum Basic: rt_graphics_sdl2 and rt_cpu_emu.

program.bas └─ Lexer keywords, literals, type suffixes └─ Parser builds the syntax tree └─ Resolver checks names, types and scopes └─ IR lowers BASIC into a simple intermediate form └─ Codegen emits x64 assembly (NASM) └─ Link + librt.a (runtime) → program.exe

rt_graphics_sdl2 — the graphics and sound engine

Every compiled program opens an SDL2 window, and rt_graphics_sdl2 draws everything that appears in it. It recreates the screen modes of a VGA-era PC pixel for pixel, then scales the picture to fit a modern monitor.

Screen modes and text

  • SCREEN 0 through SCREEN 13 with the original resolutions, colour counts and default palettes, including the 256-colour VGA palette of SCREEN 13
  • QB64 32-bit colour screens and off-screen images with _NEWIMAGE
  • PRINT, LOCATE, COLOR and VIEW PRINT in every mode, with the full CP437 character set (box-drawing, accented letters, symbols) in built-in 8×8, 8×14 and 8×16 fonts
  • Blinking text, and a blinking cursor for INPUT in graphics modes
  • TrueType fonts with _LOADFONT and _FONT when SDL2_ttf.dll is present (programs still start without it)

Drawing

  • PSET, PRESET, LINE (boxes, filled boxes, styled lines), CIRCLE (arcs and ellipses), PAINT and DRAW
  • VIEW viewports, WINDOW coordinates and PMAP
  • PALETTE and PALETTE USING
  • Sprites with GET and PUT (PSET, PRESET, AND, OR, XOR)
  • Multiple screen pages with PCOPY for flicker-free animation

QB64 images, input and window

  • Image handles: _NEWIMAGE, _LOADIMAGE (BMP, PNG, JPG, GIF, SVG), _PUTIMAGE with scaling, _DEST, _SOURCE, _SETALPHA, _FREEIMAGE
  • Colour functions: _RGB32, _RGBA32, _RED32 and friends
  • Keyboard: INKEY$, _KEYDOWN (several keys held at once), _KEYHIT, _KEYCLEAR
  • Mouse: _MOUSEINPUT, _MOUSEX, _MOUSEY, _MOUSEBUTTON
  • Window: _TITLE, _ICON, _FULLSCREEN, _SCREENMOVE, and smooth game loops with _DISPLAY and _LIMIT
  • Simple on-screen controls: BUTTON, CHECKBOX, RADIOBUTTON

Sound

  • A 32-voice software mixer: up to 32 sounds play at once, each with its own volume (_SNDVOL) and left/right balance (_SNDBAL)
  • WAV (PCM, float and ADPCM) and Ogg Vorbis files with _SNDOPEN, _SNDPLAY, _SNDLOOP, _SNDPLAYCOPY, _SNDPLAYFILE and the rest of the QB64 sound set
  • _SNDRAW, _SNDRATE and _SNDRAWLEN stream samples you calculate yourself, mixed in with the voices above
' a one-second 440 Hz beep, made sample by sample
FOR i = 1 TO _SNDRATE
    _SNDRAW SIN(i / _SNDRATE * 440 * 6.2832) * 0.3
NEXT i
DO: LOOP WHILE _SNDRAWLEN

rt_cpu_emu — the DOS memory and CPU emulator

Many classic BASIC programs reach past BASIC and talk to the PC directly: they POKE straight into video memory, read the keyboard flags from the BIOS data area, or run small machine-code routines. On 64-bit Windows those addresses don't exist, and touching them would crash the program. rt_cpu_emu is a custom-written layer that recreates that old PC world inside your program, so the code runs as it did under DOS.

An emulated real-mode memory map

AddressWhat happens
&HA000VGA graphics memory. In SCREEN 13 each byte you POKE is a pixel, and it shows up in the window in the right palette colour. PEEK reads it back.
&HB800Colour text memory: the 80×25 grid of characters and attribute bytes. Programs that draw screens by poking text memory display correctly.
&H0000–&H9FFFConventional memory, including the interrupt table and the BIOS data area. It starts out filled in the way a real BIOS leaves it: Caps/Num/Scroll Lock state taken from your keyboard, 640K of memory, colour 80-column display.
DEF SEG = 0Addresses from VARPTR and SADD go straight to your program's own variables, so the PEEK/POKE tricks that work on BASIC data still work.
' fill the SCREEN 13 display through video memory
SCREEN 13
DEF SEG = &HA000
FOR i = 0 TO 63999: POKE i, i MOD 256: NEXT i
DEF SEG

CALL ABSOLUTE and CALL INTERRUPT

  • CALL ABSOLUTE runs the 16-bit machine code the program built in an array through a small built-in 8086 interpreter, with its own registers and stack. It covers the short routines BASIC programs typically carried: register loads, PUSH/POP, INT calls and RET.
  • Interrupts made from that code, or from CALL INTERRUPT and CALL INTERRUPTX with a RegType structure, are answered by emulated DOS and BIOS services and carried out with Windows: DOS functions (INT 21h), video (INT 10h), the mouse driver (INT 33h) and the printer (INT 17h).

The result: programs written for real DOS hardware in the 1980s and 1990s can be compiled and run as 64-bit Windows programs, usually without changing a line.

Getting started

Download the zip and extract it to a folder. Then use the IDE or the command line.

The IDE: double-click qb71ide.exe. Write your program in the editor, then press F5 to compile and run it, or F8 to step through it. Press F1 for help on any keyword.

Important: every new program must be saved before you run it in the IDE.

The command line: open a command prompt in the folder and compile your program:

C:\QuantumBASIC> qb71 program.bas

That makes program.exe in the same folder. Run qb71 -h to see all the options.

Updating

Downloaded before November 5, 2026? Your copy doesn't have the automatic updater. Download QuantumBASIC.zip again and extract it over your old folder, or into a new one. After that, every new version arrives through Help > Check for Updates.

From version 1.1.8 on, you don't need the full download for new versions. In the IDE choose Help > Check for Updates. It compares your version with the latest one, downloads only the compiler, runtime, IDE and help files that changed, checks each file, and keeps your old files in a backup folder. If you're already up to date it says so.

Options > Check for Updates at Start makes the IDE check by itself each time it opens.

Requirements

  • Windows 7 64-bit or later for the compiler and IDE
  • Programs you compile also run on 64-bit Windows XP
  • Optional: SDL2_ttf.dll next to your program for TrueType fonts
Quantum Basic 7.1 · v1.1.38