╔═══════════════════════════════════════════════════╗
║ ║
║ **** SYNTHETIC C64-STYLE BASIC V1.0 **** ║
║ ║
║ CLEAN-ROOM IMPLEMENTATION - NOT COMMODORE ROM ║
║ 63999 BYTES FREE ║
║ ║
║ READY. ║
║ _ ║
╚═══════════════════════════════════════════════════╝
Introduction
Welcome to C64 BASIC (Synthetic) on the Emulator.ca Systems network.
This service provides a line-numbered BASIC programming shell rendered on the classic Commodore 64-style 40×25 text screen. You can write and run BASIC programmes directly in your terminal.
:::caution[FIDELITY NOTICE — PLEASE READ] Fidelity badge: synthetic-fixture-compatible.
This service does not bundle, execute, or derive from any Commodore intellectual property:
- No Commodore BASIC V2 ROM — the BASIC interpreter is an independently authored, clean-room TypeScript implementation that understands the same surface syntax.
- No KERNAL ROM — there is no Commodore KERNAL; the serial I/O path is a modern backend service.
- No CHARGEN ROM — the character glyphs are rendered by the existing synthetic PETSCII-to-Unicode mapping.
- No commercial software — no PRG, D64, or tape images are loaded or executed.
Hardware-specific Commodore BASIC V2 features — POKE, PEEK, SYS, LOAD, SAVE, GET, cursor-colour keywords, and the CBM character set — are not present in this interpreter and will produce ?SYNTAX ERROR. See the Fidelity Notes section for a complete accounting.
If you want the full Commodore BASIC V2 experience, you must supply your own ROM bytes and use a dedicated emulator. :::
What You Can Do
Dial 555-6510, write a line-numbered BASIC programme, type RUN, and watch it execute on a C64-style 40×25 colour screen. The programme output appears both in your terminal and in the rendered C64 video buffer. Classic tutorials and type-in listings that use PRINT, LET, GOTO, IF/THEN, INPUT, and REM will work.
ATDT555-6510
CONNECT 1200
**** SYNTHETIC C64-STYLE BASIC V1.0 ****
CLEAN-ROOM IMPLEMENTATION - NOT COMMODORE ROM
63999 BYTES FREE
READY.
10 PRINT "HELLO FROM EMULATOR.CA"
20 GOTO 10
RUN
HELLO FROM EMULATOR.CA
HELLO FROM EMULATOR.CA
...
Quick Start
- Dial
555-6510from the EC-TTY main menu. - The startup banner confirms: Synthetic implementation, not Commodore ROM.
- Type a line-numbered statement and press Enter to store it. Stored or deleted numbered lines are accepted silently after your echoed input;
READY.appears after immediate commands, program completion, and errors. - Type
RUNand press Enter to execute. - Hang up (
+++thenATH) to disconnect.
10 LET X = 1
20 PRINT "X = "; X
30 LET X = X + 1
40 IF X <= 5 THEN 20
50 END
RUN
X = 1
X = 2
X = 3
X = 4
X = 5
READY.
Connecting
Dialling In
ATDT555-6510
The connection sequence:
- The MOS 6502 WASM emulator loads (used as video memory store only — no 6502 programme runs).
- The 40×25 screen is cleared; default colours: light blue on blue.
- The C64TextAdapter begins rendering at 30 fps.
- The synthetic BASIC banner and
READY.prompt appear. - The shell accepts line-numbered input.
Modem Profile
C64 BASIC (Synthetic) uses a V.32bis-capable answer profile. The current browser-local modem path normally negotiates CONNECT 1200; the high-speed profile label describes the service capability rather than a promise that every caller connects at 14,400 baud.
Terminal Requirements
- VT100 or ANSI emulation with colour support.
- 80 columns minimum (the 40-column C64 display is centred).
- 16-colour ANSI for accurate palette rendering.
Language Reference
Programme Structure
Programmes are stored as line-numbered statements:
<line-number> <statement>
- Line numbers must be integers from 1 to 9999.
- Lines are executed in ascending numerical order.
- Entering a line number with no statement deletes that line.
- Statements are stored as typed; they are uppercased before execution.
- Numbered-line storage and deletion are silent after the echoed input, matching the programme-entry feel of classic BASIC. Use
LISTto confirm stored lines.
Immediate Commands
| Command | Effect |
|---|---|
NEW |
Clear the programme and all variables |
LIST |
Print all stored lines in order |
RUN |
Execute the stored programme |
CLR |
Clear variables without clearing the programme |
Statements
PRINT ← blank line
PRINT expr ← print value + newline
PRINT expr; expr ← print items without separator
PRINT expr, expr ← print items with tab stop
PRINT expr; ← print without trailing newline
expr may be a string literal ("text"), a numeric literal, a variable name, or an arithmetic/comparison expression.
LET
LET var = expr
var = expr ← LET keyword is optional
Numeric variables hold floating-point numbers; string variables have a $ suffix.
Examples:
10 LET X = 42
20 LET A$ = "HELLO"
30 X = X * 2
GOTO
GOTO linenum
Branches unconditionally to the given line number. If the line does not exist, ?UNDEFINED STATEMENT is reported and execution halts.
IF / THEN
IF expr THEN linenum
IF expr THEN GOTO linenum
IF expr THEN statement
expr is treated as false if zero and true otherwise. Comparison operators (=, <>, <, >, <=, >=) return 1 (true) or 0 (false).
Examples:
30 IF X > 10 THEN 60
40 IF A$ = "QUIT" THEN END
50 IF N <> 0 THEN GOTO 100
INPUT
INPUT var
INPUT "prompt"; var
Pauses execution, optionally displays a prompt, and reads one line of user input. Numeric variables receive the parsed number (0 if non-numeric); string variables receive the raw text.
REM
REM any text
Comment — the rest of the line is ignored.
END / STOP
Halt execution and return to READY..
Expressions
| Operator | Meaning |
|---|---|
+ |
Addition (or string concatenation) |
- |
Subtraction |
* |
Multiplication |
/ |
Division (returns 0 on divide-by-zero) |
= |
Equal (comparison) |
<> |
Not equal |
< |
Less than |
> |
Greater than |
<= |
Less than or equal |
>= |
Greater than or equal |
Operator precedence (high to low): unary minus → * / → + - → comparisons.
Parentheses override precedence: (2 + 3) * 4 = 20.
Variables
- Numeric: single uppercase letter, or letter followed by digits/letters:
A,X1,COUNT. - String: numeric name with a
$suffix:A$,NAME$. - All variables are zero (numeric) or empty string (string) until assigned.
CLRresets all variables to their defaults.
The Video Display
Programme output is written to the C64-style 40×25 character grid:
Row 0: ┌──────────── 40 columns ────────────┐
Row 1: │ SYNTHETIC C64-STYLE BASIC V1.0 │
... │ │
Row 24: └──────────────────────────────────────┘
- Screen RAM: $0400–$07E7 (1,000 bytes).
- Colour RAM: $D800–$DBE7 (1,000 nybbles); default light blue.
- Background: $D021 — blue.
- Border: $D020 — light blue.
The video adapter reads these memory regions 30 times per second and renders them as ANSI escape sequences.
Sample Programmes
Hello World
10 PRINT "HELLO, WORLD!"
20 END
RUN
Count to Ten
10 LET N = 1
20 PRINT N
30 LET N = N + 1
40 IF N <= 10 THEN 20
50 END
RUN
Arithmetic Table
10 PRINT "N", "N*N"
20 LET N = 1
30 PRINT N, N * N
40 LET N = N + 1
50 IF N <= 9 THEN 30
60 END
RUN
User Input
10 INPUT "ENTER YOUR NAME: "; N$
20 PRINT "HELLO, "; N$; "!"
30 END
RUN
Fidelity Notes
This interpreter is an independent clean-room implementation of BASIC language syntax. It is not Commodore BASIC V2 or any derivative thereof.
| Feature | Status |
|---|---|
PRINT, LET, GOTO, IF/THEN, INPUT, REM, END, STOP |
✅ Implemented |
CLR, NEW, LIST, RUN |
✅ Implemented |
String concatenation (A$ + B$) |
✅ Implemented |
Numeric arithmetic (+, -, *, /) |
✅ Implemented |
| Comparison operators | ✅ Implemented |
GOSUB / RETURN |
❌ Not implemented |
FOR / NEXT |
❌ Not implemented |
DATA / READ / RESTORE |
❌ Not implemented |
DIM (arrays) |
❌ Not implemented |
POKE / PEEK |
❌ Not applicable (no raw memory access) |
SYS |
❌ Not applicable |
LOAD / SAVE |
❌ Not implemented |
GET |
❌ Not implemented |
Built-in functions (INT, RND, SQR, ABS, CHR$, ASC, LEN, etc.) |
❌ Not implemented |
| Sprite graphics, sound, hardware registers | ❌ Out of scope |
Multiple statements per line (: separator) |
❌ Not implemented |
| Commodore BASIC error messages (exact text) | ❌ Messages differ |
| Commodore CBM character set | ❌ ASCII/PETSCII mapping only |
See Also
- C64 Graphics (555-6502) — SLP demo programme running on the emulated 6502 CPU with the same 40×25 video surface.
- VIC-20 Graphics (555-6520) — The VIC-20 predecessor with 22×23 display.
- SLP-BASIC (555-0300) — Full Commodore BASIC V2-compatible interpreter (text-only surface, no C64 video).
C64 BASIC (Synthetic) — Clean-Room BASIC Shell on the C64 Video Surface
Emulator.ca Systems
Document Revision 1.0