Quantum Basic 7.1
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.
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.
✉ myorders@mail.com
Screenshots
Click a picture to see it full size. Use the arrow keys to go through them.
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
.nesgame 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.
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.
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 Xin the Immediate window shows the value ofXin 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,TYPEorDECLARE LIBRARYand the editor adds theEND IF,NEXT,LOOP,WEND,END SELECT,END TYPEorEND DECLARENEW 1.1.17 - Auto Spacing formats each line as you leave it, like QB64:
a=5becomesa = 5andPRINT a,b;cbecomesPRINT a, b; c. Strings, comments and DATA are left alone NEW 1.1.16 - Type
SUB NameorFUNCTION Nameand press Enter, and the editor adds theEND SUBorEND FUNCTIONfor 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$USELIBRARYfor programs written for other BASIC compilersON ERROR _NEWHANDLERandON ERROR _LASTHANDLER: error handlers that stack, so a SUB can set its own handler and then put the previous one backDIM [SHARED] AS type a, b, candREDIM AS type, declaring several variables of one type at once$ERRORLOCATIONis 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
_LOADIMAGEloads SVG drawings as well as BMP, PNG, JPG and GIF_LOADIMAGEwith 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
FIELDstring 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 theFIELDstatement had a garbage length, soMID$(a$, n) = fieldvar$copied nothing and, for example, the DHPOS report programs printed the previous record's data for every item.MID$,UCASE$,LCASE$,PRINTand the string functions now all see the FIELD width NEW 1.1.28 STATICvariables followDEFLNGand the other DEF types, the type suffix andAStype, as in QB (they were all INTEGER) NEW 1.1.27GET #f, , text$in BINARY mode reads exactlyLEN(text$)bytes, as in QB (it read to the end of the file) NEW 1.1.26_LIMITkeeps an exact rate:_LIMIT 60is 60 frames a second NEW 1.1.26- PSET and the other drawing on a
_NEWIMAGEimage is several times faster NEW 1.1.26 - An
_UNSIGNED _INTEGER64given a number of 2^63 or more (b = 10000000000000000000) now holds it instead of 9223372036854775808 NEW 1.1.25 _CONSOLE OFFand_CONSOLE ONhide and show the$CONSOLEwindow NEW 1.1.24- QB64
ASC(text$, position) = codestatement changes one character of a string in place NEW 1.1.23 $FORCELPRINTat the top of a program makesLPRINTandOPEN "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 sendsLPRINTto 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.21LPRINToutput now prints when the program ends,LPRINT TAB(n)goes to column n, a comma goes to the next print zone, andLPRINT USINGnumbers 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" ()andDECLARE 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
TYPEcan now hold anotherTYPE(Ship AS SHIP, thenPlayer(1).Ship.rect.x1). Copying, passing to aSUBorFUNCTIONand 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 SLEEPand "Press any key to continue" now wait for a new key press. Before, one key press could end severalSLEEPs 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, likeSPC(n)NEW 1.1.12- Inside a
DECLARE LIBRARYblock, lines written asDECLARE FUNCTION ...orDECLARE SUB ...now work, the same asFUNCTION .... Before, they were skipped and the functions returned 0 or "" NEW 1.1.11 - Programs with many
FIELDstatements no longer crash - An unclosed block at the end of a program (a
FORwithoutNEXT) 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
-goption makes a debug build. The IDE uses it for debugging; F11 Make EXE always makes a normal program qb71 -hlists all the options
The debugger at a glance
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.
| Key | Does |
|---|---|
| F8 | Step: run one statement. If the program isn't running, start it and stop before the first statement |
| F10 | Procedure Step: like F8, but a SUB or FUNCTION call runs as one step |
| F9 | Toggle Breakpoint on the cursor line |
| F7 | Run to Cursor |
| F5 | Continue (or run, when no program is running) |
| Shift+F5 | Start the program again from the beginning |
| Shift+F9 | Instant Watch: watch the variable under the cursor |
| Ctrl+Break | Stop 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
- Compiles QuickBASIC and PDS 7.1 programs to native 64-bit Windows executables
- Supports many QB64 extensions:
_NEWIMAGE,_PUTIMAGE,_LOADIMAGE,_KEYDOWN,_SNDOPEN,_MEMand more - Graphics in every SCREEN mode through an SDL2 window, including 32-bit color screens
- Emulates the DOS memory map, so
DEF SEG,PEEK,POKE,CALL ABSOLUTEandCALL INTERRUPTstill do what they used to - Sound from WAV and OGG files, plus raw sample streaming
- An IDE in the classic PDS 7.1 blue, with color schemes, F1 help, error highlighting and a debugger
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.
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 0throughSCREEN 13with the original resolutions, colour counts and default palettes, including the 256-colour VGA palette ofSCREEN 13- QB64 32-bit colour screens and off-screen images with
_NEWIMAGE PRINT,LOCATE,COLORandVIEW PRINTin 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
INPUTin graphics modes - TrueType fonts with
_LOADFONTand_FONTwhenSDL2_ttf.dllis present (programs still start without it)
Drawing
PSET,PRESET,LINE(boxes, filled boxes, styled lines),CIRCLE(arcs and ellipses),PAINTandDRAWVIEWviewports,WINDOWcoordinates andPMAPPALETTEandPALETTE USING- Sprites with
GETandPUT(PSET, PRESET, AND, OR, XOR) - Multiple screen pages with
PCOPYfor flicker-free animation
QB64 images, input and window
- Image handles:
_NEWIMAGE,_LOADIMAGE(BMP, PNG, JPG, GIF, SVG),_PUTIMAGEwith scaling,_DEST,_SOURCE,_SETALPHA,_FREEIMAGE - Colour functions:
_RGB32,_RGBA32,_RED32and 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_DISPLAYand_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,_SNDPLAYFILEand the rest of the QB64 sound set _SNDRAW,_SNDRATEand_SNDRAWLENstream 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
| Address | What happens |
|---|---|
| &HA000 | VGA 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. |
| &HB800 | Colour text memory: the 80×25 grid of characters and attribute bytes. Programs that draw screens by poking text memory display correctly. |
| &H0000–&H9FFF | Conventional 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 = 0 | Addresses 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 ABSOLUTEruns 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,INTcalls andRET.- Interrupts made from that code, or from
CALL INTERRUPTandCALL INTERRUPTXwith aRegTypestructure, 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.dllnext to your program for TrueType fonts







