Hi,
I have been enjoying working on the LOGO parser and it inspired me to look at an AppleSoft Basic interpreter that I started over a year ago without too much success. The attached files include a fairly well-along AppleSoft Basic interpreter and a file of test programs that all work. Most of the explanation of what is going on is in the stack script header.
Once I have the rest of the text-based commands working I will start work on implementing Apple IIe graphic modes (I also want to include SHR modes like on the IIGS and what I think a IIGS+ with a 65832 processor may have been capable...why not?)
It is far enough along I thought it might be of interest.
-Mike
[ 9/6: Updated version v2.4 posted below, see stack script header for version history. Added many test programs and 2 demos.
AppleSoft Basic Interpreter Project
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
AppleSoft Basic Interpreter Project
- Attachments
-
- AppleSoft Basic Interpreter v2.4.0_ Build 090525.livecode.zip
- (16.23 KiB) Downloaded 1 time
-
- 2. Working Demo Programs.zip
- (2.89 KiB) Downloaded 1 time
-
- 1. Test Programs.zip
- (30.88 KiB) Downloaded 1 time
Last edited by Hutchboy on Sun Sep 07, 2025 4:18 am, edited 1 time in total.
Re: AppleSoft Basic Interpreter Project
Mike.
Hard for me to understand what this rather hefty stack does. Can you give a short tutorial?
Craig
Hard for me to understand what this rather hefty stack does. Can you give a short tutorial?
Craig
Re: AppleSoft Basic Interpreter Project
Mike:
Another supreme effort! I enjoyed the test programs.
The answer to Test #3, however, does not seem correct.
It should go to Line 50 but, instead, it goes to Line 30 and prints FAIL.
Otherwise, the test programs were all sucessful.
What a project!
Bob
Another supreme effort! I enjoyed the test programs.
The answer to Test #3, however, does not seem correct.
It should go to Line 50 but, instead, it goes to Line 30 and prints FAIL.
Otherwise, the test programs were all sucessful.
What a project!
Bob
Re: AppleSoft Basic Interpreter Project
Craig,
The stack is an AppleSoft Basic Interpreter. It will eventually be able to run most AppleSoft Basic programs. When I am to the point where I can run interesting demos I will add those as a kind of tutorial. In the meantime Google "online AppleSoft Basic" and you will see examples of really good interpreters.
Bob,
Thanks. In the test programs I think I need to remove any semi-colon comments at the top line and just run the actual line numbers. Right now I am much farther along and am working onv2.3. Here is my roadmap:
v2.3 — Control-flow enrichments
ON GOTO / ON GOSUB
STOP / CONT scaffolding
v2.4 — INPUT upgrades
Multiple targets: INPUT "Prompt"; A, B$, C(I) with comma parsing & coercion, quoted strings respected.
Array targets allowed; graceful handling of too few/many inputs in one line.
Smoke tests: mixed numeric/string/array, empty input → default, whitespace/quotes, extra commas.
v2.5 — Core functions (minimal but useful)
Numeric: INT, ABS, SGN, SQR, RND (with RND(0), RND(1), RND(n) semantics).
String: LEN, LEFT$, RIGHT$, MID$, ASC, CHR$, VAL, STR$.
v2.6 — PRINT utilities
v2.7 — Polishing & Demo Time
v2.8+ — Graphic Modes, PEEKS & POKES, Kitchen Sink Demos
-Mike
The stack is an AppleSoft Basic Interpreter. It will eventually be able to run most AppleSoft Basic programs. When I am to the point where I can run interesting demos I will add those as a kind of tutorial. In the meantime Google "online AppleSoft Basic" and you will see examples of really good interpreters.
Bob,
Thanks. In the test programs I think I need to remove any semi-colon comments at the top line and just run the actual line numbers. Right now I am much farther along and am working onv2.3. Here is my roadmap:
v2.3 — Control-flow enrichments
ON GOTO / ON GOSUB
STOP / CONT scaffolding
v2.4 — INPUT upgrades
Multiple targets: INPUT "Prompt"; A, B$, C(I) with comma parsing & coercion, quoted strings respected.
Array targets allowed; graceful handling of too few/many inputs in one line.
Smoke tests: mixed numeric/string/array, empty input → default, whitespace/quotes, extra commas.
v2.5 — Core functions (minimal but useful)
Numeric: INT, ABS, SGN, SQR, RND (with RND(0), RND(1), RND(n) semantics).
String: LEN, LEFT$, RIGHT$, MID$, ASC, CHR$, VAL, STR$.
v2.6 — PRINT utilities
v2.7 — Polishing & Demo Time
v2.8+ — Graphic Modes, PEEKS & POKES, Kitchen Sink Demos
-Mike