Shop OBEX P1 Docs P2 Docs Learn Events
ebasic on Martin's DNA board or other Propeller boards that support external memory — Parallax Forums

ebasic on Martin's DNA board or other Propeller boards that support external memory

David BetzDavid Betz Posts: 14,519
edited 2012-07-20 17:16 in Propeller 1
I got a few questions about my ebasic demo program for Propeller GCC so I thought I'd start another thread to avoid hijacking Martin's thread about his DNA boards.

ebasic is a simple version of Basic that is derived from another language I wrote a while back called xbasic. xbasic works a lot like Spin in that it has a compiler that runs on a PC that generates bytecodes that are interpreted by a virtual machine running on the Propeller. What I did to create ebasic was to simplify the syntax of the xbasic language and merge the compiler with the runtime so ebasic programs are compiled to bytecode on the Propeller and then the resulting bytecode is run by a virtual machine also on the Propeller. I combined this with a very simple line-oriented editor and a way to load or save programs to an SD card.

However, ebasic is really still just a demo program. More work needs to be done if it is going to be used for anything serious. The main problem with it in its current state is that it does a poor job of making the most of hub memory. I'll try to improve that is I have time. Also, the virtual machine that runs xbasic programs is much faster than the one that runs ebasic programs. I'd like to make ebasic use the xbasic VM eventually.

I've attached a zip file containing the latest version of ebasic to this message. In that zip file is a README.txt file that gives a sketchy description of the language syntax and runtime functions. I'll try to improve that as well.

ebasic.zip (updated July 20, 2012, 5:30pm EST)

Also, I'm currently working on ebasic2 which has been renamed to pico-basic. It will have more conventional basic features like dynamic strings and floating point. There is a Google Code project setup for pico-basic if you're interested. It's still a work in progress though.

http://code.google.com/p/pico-basic/

Comments

  • David BetzDavid Betz Posts: 14,519
    edited 2012-07-20 14:36
    I've just fixed the stack overflow bug that Martin reported in his DNA thread. The following program now runs correctly on the Parallax C3 board and flashes the LED.
    5 led=15
    10 out(led,0)
    20 do
    30   high(led)
    35   pause(500)
    40   low(led)
    45   pause(500)
    50 loop
    
    The updated code is in the first post in this thread. If anyone else tries ebasic and finds problems please let me know so I can fix them!

    Thanks,
    David
  • Cluso99Cluso99 Posts: 18,071
    edited 2012-07-20 17:16
    Nice work David. Another addition to the prop toolbox.
Sign In or Register to comment.