I recently got my hands on a SMART Response XE, which is a defunct education device based on a ATMega128RFA1. It's basically a beefy arduino with a keyboard and screen.
The device that I bought came preloaded with a fork of Arduino BASIC. It took me an hour or two to get the basic control flow down, but its simpler than I expected.
The REPL flow is quite nice.
You can swap between 9 banks of memory using mload {slot} and msave {slot} where slot is between 0 and 9.
You can immediately execute an expression by typing it and hitting enter.
You add code to your program by prefixing an expression with a line number.
To delete a line, type the line number without any extra characters.
Use list to see your source and run to run your program.
These take a line number as an argument so you can skip around.
In a modern language like Python, you're given more control over execution flow of the program.
In particular, IF expressions are limited to a single expression.
If you want to run multiple lines in a branch of code, you must jump to a line to continue execution in that code block.
The result of this is that line numbering becomes something that you need to mindful of during development.
There are a couple of minor improvements that I would make on the implementation of BASIC on this device.
- I would set
enterto be the down or right key. I keep wanting to use thebackspacekey for it's intended purpose, and it's a little annoying to have to change it. A dynamic setting could be cool, built into the environment as a function. - When running
LIST, hitting enter or down skips the last line in the entry, which means I can't see all the code I've written. This is a small off-by-one error. I think this is related to setting the position to the 7th row; if I do this and print a value, then we'll automatically scroll the buffer forward. - Hitting
qwhen listing code should put me back into the the main interpreter. It would also be nice to see a pager of some kind at the bottom of the screen (like less), but it's by no mean necessary. - I would like a way to edit the current line using direction keys, without having to delete everything that I just wrote.
- I would also like a buffer for history. Pressing
upshould bring up the previous statement, like sh/bash. - Hitting any of the buttons for math (=,+,-,x,/) is awkward. I need to have both fingers on the left-hand side of the keyboard. The bottom two keys of the display would be useful as extra modifier keys, since they're currently not doing anything.
meta+shift+vmakes for a very unintuitive underscore. This should probably be under-. Actuallyshift+spaceis probably supposed to be the combo.- A
HELPfunction might to start programming without having to dive into various docs. Alternatively, having a canonical reference with some examples would be cool. I'll try to include some useful examples in this doc, but it would be nice to have it built into the system. - The
POSITIONfunction doesn't work correctly.
- https://www.tindie.com/products/subsystems/smart-response-xe-with-arduino-basic/
- https://www.tindie.com/products/bradanlane/smart-response-xe-developer-kit/
- https://hackaday.com/tag/smart-response-xe/
- https://github.com/robinhedwards/ArduinoBASIC
- https://github.com/Subsystems-us/SMART-Response-XE-Tiny-Basic-Port
- https://gitlab.com/bradanlane/srxecore
- https://simba-os.readthedocs.io/en/latest/
- http://www.ulisp.com/
- https://www.bigmessowires.com/2016/05/06/fc8-faster-68k-decompression/


Read through this blog post on cosine from scratch. I had ChatGPT write me a cosine implementation; it looks like the taylor expansion implementation is simpler to implement that I originally thought. https://chat.openai.com/share/c6b2a3a7-08c2-4ed2-a453-70a3f8b99f78
Taylor approximation:
Code (which needs to be simplified for entry):
Finally a sample program: