Open PSLLSP opened 4 years ago
Hello!
It's been 4 years, but if anyone want to prevent their basic code from being lost, write it in notepad and then send the file using terminal (if possible), Terra Term have a file>send file... option that works in this fashion, it allows to paste content from clipboard too or just log your activity from which you can retrieve eventually what you lost.
Programmers are humans and they do mistakes. One of them is that they write a code that runs, by a mistake, in never ending loop. BusPirate BASIC doesn't allow user to exit from never ending loop. When BASIC programs runs the never ending loop, BusPirate device has to be disconnected and BASIC script is lost. Find an error, type script and try again.. ;-)
This was my favorite BASIC program in the past century when I played with ZX-Spectrum (the first program in ZX-Spectrum BASIC tutorial?):
Type
RUN
and try to break the loop back to the command prompt... ;-)Another example, less crude program, try to break the loop before it reach 10000:
BASIC at BusPirate has other interesting features, the simplest way to crash BASIC script:
Yes, there is no output and you have to reconnect your BusPirate device to reach command prompt... I have found several bugs like this that valid commands crash BASIC script and program is lost... That makes scripting PirateBus in BASIC script very difficult and time consuming.
It is not easy to type BASIC scripts to terminal but I have found that Python project to run scripts on BusPirate makes my life easier. It is here https://github.com/clvLabs/BusPirate
Script to upload simple BASIC script to BP:
WARNING,
buspirate.py
starts communication with RESET command#
, script at BP device is deleted during reset... And I addednew
command to my script too, it is needed in the case that BP is already in BASIC mode and#
command doesn't work...Note. To enter BASIC mode, enter
s
command from BP modes, to exit from BASIC back to command interface, use typeexit
. Program is not lost afterexit
and you can return to BASIC mode withs
command and continue your scripting.Note that pressing ENTER with no command in BASIC mode results in "Syntax error". This is a bug from my point if view... Other interesting feature of this micro BASIC is that it doesn't like lower case strings, it converts them to uppercase strings. That was a feature of BASIC at ZX-81 because there were no lowercase characters on the keyboard and no space for lowercase characters in character generator for the screen. We have year 2020 and we are back, that is called evolution... ;-)
My BusPirate is from eBay, small cute box with two LEDs.