Add a TinyBASIC implementation. #3

Merged
bcox merged 3 commits from tinybasic into main 2026-03-25 20:11:45 +00:00
Owner

This adds an integer TinyBASIC implementation.

This adds an integer TinyBASIC implementation.
Line-numbered integer BASIC inspired by Li-Chen Wang's Palo Alto Tiny
BASIC (1976). 14-bit unsigned arithmetic, 26 variables (A-Z), recursive
descent expression parser, FOR/NEXT loops, GOSUB subroutines, INPUT,
IF/THEN, and two built-in functions (ABS, RND).

Includes beginner-oriented documentation, two sample programs (number
guessing game, multiplication table), and a `just basic` build recipe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_console_scroll now saves/restores CD and EF, fixing register
corruption when scroll was called from the LF and TAB fast paths
(which don't push CD/EF themselves). This was causing TinyBASIC
programs to be silently corrupted after enough output to trigger
scrolling.

To reclaim the 4 bytes needed for the extra PUSH/POP pairs:
- Refactored putchar_addr to call clear_row_start instead of
  duplicating the row-address calculation (saves 6 bytes)
- Removed redundant LD A,#0 in _blink_disabled (saves 2 bytes)

Also fixes:
- EXITSYS macro uses RST 0 instead of RET (both rom and tinybasic)
- GOXY macro whitespace (tab vs spaces)
- TinyBASIC input now folds lowercase a-z to uppercase A-Z

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bcox merged commit ce201de29a into main 2026-03-25 20:11:45 +00:00
bcox deleted branch tinybasic 2026-03-25 20:11:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bcox/sbc7!3
No description provided.