Applesoft BASIC in JavaScript
Go to file
2017-11-12 19:15:49 -08:00
cm Simplify tokenizers; remove jslint cruft 2013-08-16 19:53:09 -07:00
res Move some resource files to res/ 2016-02-05 20:42:40 -08:00
samples Added 'Snowflakes' sample 2017-08-27 18:47:08 -07:00
tools Squish the font bitmaps 2013-08-18 15:30:55 -07:00
vfs Snapshot 2012-02-08 22:13:44 -05:00
.gitignore Remove old ignore entry 2013-05-08 00:00:56 -04:00
basic.js Animate paper showing/hiding; add a few more compat shims; fix docs for CALL 54915 2017-08-15 10:10:30 -07:00
bell.js Use WebAudio for beep, if available 2017-02-19 21:17:01 -08:00
bs.html Add script example 2013-12-08 15:56:19 -08:00
display.css Move some resource files to res/ 2016-02-05 20:42:40 -08:00
dos.js Avoid RegExp.$1 and friends 2016-10-13 22:17:30 -07:00
favicon.ico Updated favicon 2015-03-12 21:25:07 -07:00
hires.js Force pixel bounds to integers 2016-09-10 11:51:19 -07:00
index.html Remove 'Fork Me' banner; clutter most users don't need 2017-11-12 19:15:49 -08:00
index.js UI tweaks 2015-12-06 16:30:35 -08:00
LICENSE.md Tweak license 2013-08-21 23:08:42 -07:00
lores.js Remove copyright/license from individual JS files 2013-08-21 23:07:46 -07:00
printer.js Remove copyright/license from individual JS files 2013-08-21 23:07:46 -07:00
README.md Remove command line support. Depend on CDN for polyfills 2016-03-08 20:31:24 -08:00
reference.html Animate paper showing/hiding; add a few more compat shims; fix docs for CALL 54915 2017-08-15 10:10:30 -07:00
script.js Bump dependencies: Polyfill and CodeMirror 2016-08-14 14:17:17 -07:00
script.md Update script.md 2017-02-19 15:17:07 -08:00
styles.css Animate paper showing/hiding; add a few more compat shims; fix docs for CALL 54915 2017-08-15 10:10:30 -07:00
tty.js Rework bell hook 2015-11-25 10:21:53 -08:00

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