C64 BASIC (Synthetic)

Synthetic Clean-Room BASIC Shell on the C64 40×25 Video Surface

Dial 555-6510 to Launch
            ╔═══════════════════════════════════════════════════╗
            ║                                                   ║
            ║  **** 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:

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

  1. Dial 555-6510 from the EC-TTY main menu.
  2. The startup banner confirms: Synthetic implementation, not Commodore ROM.
  3. 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.
  4. Type RUN and press Enter to execute.
  5. Hang up (+++ then ATH) 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:

  1. The MOS 6502 WASM emulator loads (used as video memory store only — no 6502 programme runs).
  2. The 40×25 screen is cleared; default colours: light blue on blue.
  3. The C64TextAdapter begins rendering at 30 fps.
  4. The synthetic BASIC banner and READY. prompt appear.
  5. 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

Language Reference

Programme Structure

Programmes are stored as line-numbered statements:

<line-number> <statement>

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

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

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: └──────────────────────────────────────┘

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 BASIC (Synthetic) — Clean-Room BASIC Shell on the C64 Video Surface

Emulator.ca Systems

Document Revision 1.0