User Tools

Site Tools


sd-8516_stellar_basic_v1.0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sd-8516_stellar_basic_v1.0 [2026/01/22 22:20] appledogsd-8516_stellar_basic_v1.0 [2026/01/28 16:08] (current) appledog
Line 3: Line 3:
 Dennis Allison’s 1975 article in Dr. Dobb’s Journal was a key moment in the history of Computer Science. It contained a formal specification of Tiny BASIC, a BASIC that could be implemented in less than 4 KB. Dennis Allison’s 1975 article in Dr. Dobb’s Journal was a key moment in the history of Computer Science. It contained a formal specification of Tiny BASIC, a BASIC that could be implemented in less than 4 KB.
  
-Stellar BASIC is very much in the same vein as Tiny BASIC, and is intended to evolve over time.+Stellar BASIC is very much in the same vein as Tiny BASIC, and is intended to evolve over time. However, Tiny BASIC itself is only a specification. One way is to compile a list of IL (intermediate language) statements. Once you have the IL interpretation you compile it and interpret it from there. On a machine with limited ram this approach can require up to 50% of the memory of a standard BASIC program. This is problematic. So machines like the C64 tokenized the statements on entry and executed them that way. The other issue with IL is that you have this compiled version and you also have the text lying around. That's two copies of the program. Which one is the 'real' program? If you remove the original text you can't necessarily LIST your code. Therefore, tokenization was settled on as a standard. 
 + 
 +Therefore, when it came time to compile the IL into a program we instead chose a C64 style tokenization, and added $99 as PRINT as a subtle homage to the adventure, the love, and the magic of the C64 era.
  
 == Core features == Core features
Line 63: Line 65:
 Please see: https://www.helloneo.ca/wiki/doku.php?id=vc-3_system_interrupt_table#int_05h_-_pao_alto_tiny_basic Please see: https://www.helloneo.ca/wiki/doku.php?id=vc-3_system_interrupt_table#int_05h_-_pao_alto_tiny_basic
  
-=== Implementation Discussion 
 I implemented it in this order: I implemented it in this order:
  
Line 83: Line 84:
 * Phase 4: IL Interpreter Core; * Phase 4: IL Interpreter Core;
 * Design IL bytecode table (~30-40 IL opcodes) * Design IL bytecode table (~30-40 IL opcodes)
 +* Command tokenizer (major hurdles to pass -- this was hard)
 * IL fetch/decode/execute loop * IL fetch/decode/execute loop
 * Expression evaluation using the stack * Expression evaluation using the stack
 * Control flow (GOTO, GOSUB, IF/THEN, FOR/NEXT) * Control flow (GOTO, GOSUB, IF/THEN, FOR/NEXT)
  
-* Phase 5: BASIC Commands (~15-20%)+* Phase 5: BASIC Commands
 * PRINT, INPUT, LET * PRINT, INPUT, LET
 * RUN, LIST, NEW, CLEAR * RUN, LIST, NEW, CLEAR
 * Integrate with term.ts to highlight a "Boot-to-basic" experience. * Integrate with term.ts to highlight a "Boot-to-basic" experience.
  
-* Phase 6: Testing & Polish (~5%)+* Phase 6: Testing & Polish
 * End-to-end BASIC program tests * End-to-end BASIC program tests
 * Error handling and status messages * Error handling and status messages
Line 98: Line 100:
 * Performance tuning * Performance tuning
  
- +=== Stack-based design
-==== Stack-based design+
 Everything in PATB is stack-based. This is a core design principle. There are three stacks: Everything in PATB is stack-based. This is a core design principle. There are three stacks:
  
sd-8516_stellar_basic_v1.0.1769120453.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki