Applesoft BASIC in JavaScript
Go to file
Joshua Bell 555f8de2ae Simulate Thunderclock in Slot 4
See the new sample for details/example.

Note that reading 12/24-hour time formats that have colons will not
currently work, as the colons will terminate input and result in
invisible ?EXTRA IGNORED errors.

Fixes #44
2024-02-10 18:22:08 -08:00
cm Simulate Thunderclock in Slot 4 2024-02-10 18:22:08 -08:00
res Move some resource files to res/ 2016-02-05 20:42:40 -08:00
samples Simulate Thunderclock in Slot 4 2024-02-10 18:22:08 -08:00
tools
vfs
.gitignore
basic.js Fix ESLint warnings (and one actual bug) 2023-01-04 19:34:48 -08:00
bell.js Use WebAudio for beep, if available 2017-02-19 21:17:01 -08:00
bs.html
display.css Move some resource files to res/ 2016-02-05 20:42:40 -08:00
dos.js Simulate Thunderclock in Slot 4 2024-02-10 18:22:08 -08:00
favicon.ico Updated favicon 2015-03-12 21:25:07 -07:00
hires.js Fix ESLint warnings (and one actual bug) 2023-01-04 19:34:48 -08:00
index.html Page: Use OPTGROUP in SELECT 2023-09-21 21:39:20 -07:00
index.js Add softswitch reads for display modes 2020-05-29 21:55:32 -07:00
LICENSE.md Update font refs to https 2018-08-15 21:55:00 -07:00
lores.js Improve GR/HGR colors 2020-06-13 10:38:34 -07:00
printer.js
README.md Update README.md 2018-08-14 13:00:32 -07:00
reference.html Simulate Thunderclock in Slot 4 2024-02-10 18:22:08 -08:00
script.js Add softswitch reads for display modes 2020-05-29 21:55:32 -07:00
script.md Update font refs to https 2018-08-15 21:55:00 -07:00
styles.css Update font refs to https 2018-08-15 21:55:00 -07:00
tty.js Simulate Thunderclock in Slot 4 2024-02-10 18:22:08 -08:00

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