Phase 2: variables, arrays, program execution, and control flow

Add variable storage (scalar and array), program line storage with
RUN/LIST/NEW, and full control flow: FOR/NEXT, GOTO, GOSUB/RETURN,
IF/THEN/ELSE, WHILE/WEND, ON GOTO/GOSUB, DATA/READ/RESTORE.

New modules: interp.c (1445 lines - execution loop and statement
dispatcher), vars.c, arrays.c, input.c. Version bumped to 0.2.0.
16 test programs pass including Leibniz pi and prime sieve.
This commit is contained in:
Eremey Valetov
2026-02-10 11:16:58 -05:00
parent d8e8375366
commit 616259537a
25 changed files with 2418 additions and 83 deletions
+7
View File
@@ -0,0 +1,7 @@
10 REM Nested FOR loops - multiplication table
20 FOR I = 1 TO 5
30 FOR J = 1 TO 5
40 PRINT I*J;
50 NEXT J
60 PRINT
70 NEXT I