JavaScript CSS HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cm Simplify tokenizers; remove jslint cruft Aug 17, 2013
res Move some resource files to res/ Feb 6, 2016
samples Added 'Snowflakes' sample Aug 28, 2017
tools Squish the font bitmaps Aug 18, 2013
vfs Snapshot Feb 9, 2012
.gitignore Remove old ignore entry May 8, 2013
LICENSE.md Tweak license Aug 22, 2013
README.md
basic.js Animate paper showing/hiding; add a few more compat shims; fix docs f… Aug 15, 2017
bell.js
bs.html Add script example Dec 8, 2013
display.css Move some resource files to res/ Feb 6, 2016
dos.js Avoid RegExp.$1 and friends Oct 14, 2016
favicon.ico Updated favicon Mar 13, 2015
hires.js Force pixel bounds to integers Sep 10, 2016
index.html Bump codemirror version Dec 25, 2017
index.js UI tweaks Dec 7, 2015
lores.js
printer.js
reference.html Animate paper showing/hiding; add a few more compat shims; fix docs f… Aug 15, 2017
script.js Bump dependencies: Polyfill and CodeMirror Aug 14, 2016
script.md Update script.md Feb 19, 2017
styles.css Animate paper showing/hiding; add a few more compat shims; fix docs f… Aug 15, 2017
tty.js Rework bell hook Nov 25, 2015

README.md

jsbasic - Applesoft BASIC in JavaScript

This is hosted for playing with at http://inexorabletash.github.io/jsbasic/

Notes & Known Issues

  • 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 LIST output format may not behave as on an Apple:
    • Keyword parsing differs from Applesoft command line. For example FOR I = S TO P doesn't collapse into FOR I = STOP.
  • 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, POKE and CALL locations 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 FN can define string functions
    • == can be used as =
    • CHR$() values > 255 do interesting things
    • HSCRN(x, y) allows probing the hi-res screen
    • hexadecimal literals e.g. $C010 can be used as numbers