DEF FN & BASIC Technique Deep-Dives
📚 Reference · 🌲 Evergreen · Owner: Ryan Gray · 2023-07 → 2025-06
Ryan Gray's investigations into Sinclair/Timex BASIC's user-defined functions — recursion, passing parameters to subroutines via the DEFADD trick, bit-testing — turning an obscure corner of BASIC into reusable technique.
Links
- No external links yet.
About
A cluster of reference-grade write-ups, mostly by Ryan Gray, that pin down how the TS/Sinclair BASIC DEF FN system really works and what you can do with it: recursive user-defined functions, the DEFADD trick for passing parameters into subroutines, and binary/bit-test techniques. Luis D'Ardis's beginner-oriented "Sinclair BASICs: DEF FN" thread is a good on-ramp. Evergreen knowledge — the kind of thing worth finding again years later.
Related discussions
- Recursive DEF FN — 4 msg · 2025-04-05 · groups.io
- DEF FuN — 6 msg · 2025-05-23 · groups.io
- Subroutine parameters via DEFADD trick — 5 msg · 2025-06-18 · groups.io
- How to do Binary Comparison (BIT Test) in Timex Basic — 22 msg · 2023-07-26 · groups.io
- Sinclair BASICs: DEF FN, Beginner — 14 msg · 2025-05-24 · groups.io
In the meetings
Discussed in 2 meeting recaps:
Topics: BASIC programming · Machine code, Z80 & assemblers · Utilities & applications