From c896fcfda3680d2bd882a6954a6a3b31973575a7 Mon Sep 17 00:00:00 2001
From: Joshua Bell
This is intended as a quick reference for the Applesoft BASIC in JavaScript by Joshua Bell.
See alsoApplesoft BASIC Quick Reference
+Statements
+Statements
+Variable Control
+Flow Control
+Error Handling
+Input/Output
+Miscellaneous
+Inline Data
+Lo-Res Graphics
+Hi-Res Graphics
+Hi-Res Shape Tables - NOT IMPLEMENTED
+Interpreter and Program State - NOT IMPLEMENTED
+Native Platform Interaction - NOT IMPLEMENTED
+Cassette Tape - NOT IMPLEMENTED
-Compatibility Shims
+Compatibility Shims
+Functions
@@ -244,9 +289,11 @@ This is intended as a quick reference for the Applesoft BASI
+Operators
+Operators
Comparison Operators
@@ -276,7 +323,9 @@ This is intended as a quick reference for the Applesoft BASI
+Error Codes
@@ -302,11 +351,11 @@ This is intended as a quick reference for the Applesoft BASI
DOS 3.3 / ProDOS Quick Reference
+DOS 3.3 / ProDOS Quick Reference
Input and Output
@@ -401,7 +452,7 @@ The page attempts to emulate the display of an Apple II system with
-When printing characters, CHR$
functions as expected for values
+When printing characters, CHR$()
functions as expected for values
from 32-126 (printable ASCII). Control characters have the typical Apple II meanings:
POKE 32,n
... POKE 37,n
+
+For the even geekier in the audience...
+For the even geekier in the audience...
Compilation is done by splitting the input into tokens which are then consumed by a recursive descent parser which outputs a JavaScript @@ -466,16 +519,16 @@ object representing the program.
from the comma-delimited, optionally-quoted values in the source. -Overall program parsing is done with a recursive descent parser.
-+Program = Line { Line } Line = line-number Statement { separator Statement } Statement = data-declaration | remark | Command | EmptyStatement @@ -487,21 +540,22 @@ Most statements compile into a function call to a library of Applesoft routines. with a standard recursive descent parser. The parser generates JavaScript expressions for each expression, which are used as arguments for the library calls. -+Expression = OrExpression - OrExpression = AndExpression [ 'OR' AndExpression ... ] - AndExpression = RelationalExpression [ 'AND' RelationalExpression ... ] - RelationalExpression = AdditiveExpression [ ( '=' | '<' | '>' | '<=' | '=<' | '>=' | '=>' | '<>' | '><' ) AdditiveExpression ... ] - AdditiveExpression = MultiplicativeExpression [ ( '+' | '-' ) MultiplicativeExpression ... ] - MultiplicativeExpression = PowerExpression [ ( '*' | '/' ) PowerExpression ... ] + OrExpression = AndExpression { 'OR' AndExpression } + AndExpression = RelationalExpression { 'AND' RelationalExpression } + RelationalExpression = AdditiveExpression { RelOp AdditiveExpression } + RelOp = '=' | '<' | '>' | '<=' | '=<' | '>=' | '=>' | '<>' | '><' + AdditiveExpression = MultiplicativeExpression { ( '+' | '-' ) MultiplicativeExpression } + MultiplicativeExpression = PowerExpression { ( '*' | '/' ) PowerExpression } PowerExpression = UnaryExpression [ '^' UnaryExpression ] UnaryExpression = ( '+' | '-' | 'NOT' ) UnaryExpression | FinalExpression FinalExpression = number-literal | string-literal | 'FN' user_function_name '(' Expression ')' - | reserved '(' Expression [, Expression ...] ')' - | identifier [ '(' Expression [, Expression ...] ')' ] + | reserved '(' Expression { ',' Expression } ')' + | identifier [ '(' Expression { ',' Expression } ')' ] | '(' Expression ')'@@ -509,9 +563,11 @@ which are used as arguments for the library calls.Since Applesoft supports re-entrant error handling and synchronous input, the output of the compiler is an array of statement-functions plus a driver function which implements the logic for walking over the array.
+
==
is supported for equality comparisons, in addition to =
CHR$
values greater than 255 generate glyphs that might be useful for certain maze games.
+ [3] When printing characters, CHR$()
values greater than 255 generate glyphs that might be useful for certain maze games.
HSCRN(x, y)
is added to allow reading the
- hires screen. On a real Apple this required a machine-language routine (or a shape table and XDRAW).
+ [4] HSCRN(x,y)
is added to allow reading the
+ hires screen. On a real Apple this required a machine-language routine (or a shape table and XDRAW
).