https://midihax.github.io/jsbasic-xl/
This is a fork of inexorabletash/jsbasic, a JavaScript implementation of Applesoft BASIC. This fork focuses on modernizing the web UI and simplifying the app into a self-contained editor and interpreter, with no bundled sample content or server-side dependencies.
Improvements over the original:
- Modern tabbed interface (Code / Output / Text Output / File Manager / LoRes Editor / Info) replacing the original single scrolling page.
- Automatic light/dark mode, following the browser's own preference.
- A File Manager tab to browse the virtual file system, and per-file Run, Edit, Download, and Delete actions, plus "Download Package" / "Upload Package" buttons to transfer every file as a single ZIP.
- A LoRes Editor tab: a 40-column pixel grid (40 rows in Mixed mode, 48 in Full) for drawing Apple II lo-res graphics with the real 16-color palette, mouse or arrow-key/Space cell selection and painting, row/column-numbered borders, Download/Upload of the image as plain
color,x,ytext, and a "Create Program" button that generates a ready-to-run Applesoft program (GR+ aDATA/READ/PLOTloop) from the drawing. - Save / Save As buttons to write the current program directly to the virtual file system, with filename validation (
.BASextension enforced, 15-character limit, letters/numbers/periods only, overwrite protection). - Keyboard shortcuts: Ctrl/Cmd+R to Run, Ctrl/Cmd+S to Save, active only when the corresponding button is available.
- The virtual file system is entirely browser-local (
localStorage) - DOS 3.3 file I/O (OPEN/READ/WRITE/etc.) no longer makes any network requests. - A dedicated Text Output tab with a persistent, copyable plain-text transcript of program output.
- A redesigned icon set and a code editor that fill the tab and match the active theme.
- Removed the bundled sample programs and seed VFS files, and the mailto-based "Share" feature, so the app ships as a bare editor and interpreter.
There's no build step or package install - index.html loads everything it needs straight from public CDNs at runtime:
- CodeMirror 5.61.1 (via cdnjs) - the syntax-highlighting code editor on the Code tab.
- JSZip 3.10.1 (via cdnjs) - builds and reads the
.ziparchives behind File Manager's "Download Package" / "Upload Package" buttons. - inexorabletash/polyfill v0.1.29 (via jsDelivr) -
polyfill.min.jsandkeyboard.js, small compatibility shims for older/nonstandard browser behavior.
- The BASIC program is compiled to JavaScript before execution. Syntax errors are therefore detected at compile-time rather than at run-time as on a traditional interpreter. For example, the following program would run without errors on an Apple since the erroneous second statement is never reached.
10 END : CHR$(PRINT) - Handling of BASIC code that does not match the canonical
LISToutput format may not behave as on an Apple:- Keyword parsing differs from Applesoft command line. For example
FOR I = S TO Pdoesn't collapse intoFOR I = STOP.
- Keyword parsing differs from Applesoft command line. For example
- Limitations:
- Floating point overflow is only detected on variable assignment.
- Only a subset of DOS 3.3 and ProDOS useful for basic file I/O are implemented.
- Only a small number of common
PEEK,POKEandCALLlocations are supported. - Commands that refer to assembly routines (
&,USR()etc.), shape tables, and tape I/O are not implemented.
- Commands that operate on the program itself (
LIST,RUN,DEL, etc.) are not implemented. - A handful of extensions are made beyond Applesoft BASIC:
- To improve readability, lines may start with
:and continue the previously numbered line. DEF FNcan define string functions==can be used as=CHR$()values > 255 do interesting thingsHSCRN(x, y)allows probing the hi-res screen- hexadecimal literals e.g.
$C010can be used as numbers
- To improve readability, lines may start with