Applesoft BASIC in JavaScript
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Joshua Bell aee6b4665f Build sample index from data file 3 months ago
cm Simplify tokenizers; remove jslint cruft 10 years ago
res Move some resource files to res/ 7 years ago
samples Build sample index from data file 3 months ago
tools Squish the font bitmaps 10 years ago
vfs Snapshot 11 years ago
.gitignore Remove old ignore entry 10 years ago
LICENSE.md Update font refs to https 5 years ago
README.md Update README.md 5 years ago
basic.js Fix ESLint warnings (and one actual bug) 5 months ago
bell.js Use WebAudio for beep, if available 6 years ago
bs.html Add script example 10 years ago
display.css Move some resource files to res/ 7 years ago
dos.js Fix ESLint warnings (and one actual bug) 5 months ago
favicon.ico Updated favicon 8 years ago
hires.js Fix ESLint warnings (and one actual bug) 5 months ago
index.html Build sample index from data file 3 months ago
index.js Add softswitch reads for display modes 3 years ago
lores.js Improve GR/HGR colors 3 years ago
printer.js Remove copyright/license from individual JS files 10 years ago
reference.html Fix typo 1 year ago
script.js Add softswitch reads for display modes 3 years ago
script.md Update font refs to https 5 years ago
styles.css Update font refs to https 5 years ago
tty.js Focus on the screen when keyboard register is read 2 years ago

README.md

jsbasic - Applesoft BASIC in JavaScript

This is hosted for playing with at https://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