RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » BASIC recommendation?
BASIC recommendation? [message #3127] Thu, 29 June 2017 10:18 Go to next message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
I'm looking for recommendations for a implementation of BASIC. Since I have multiple processors I'm interested in, I'm looking for something reasonably portable, probably written in C. It'd be nice if one could add, when available, functions for things like graphics, files, etc following some kind of "standard".

I have a copy of "Tiny Basic Intermediate Language Interpreter -- 2004 July 19" which has some of the functionality I'm looking for. I'll probably use it unless someone has a better suggestion.

Thanks.



Mike
Re: BASIC recommendation? [message #3128 is a reply to message #3127] Thu, 29 June 2017 13:18 Go to previous messageGo to next message
jcoffman is currently offline  jcoffman
Messages: 332
Registered: October 2015
Senior Member
Some time ago I looked at Bywater BASIC: https://sourceforge.net/projects/bwbasic/

But I forget how much of it is written in C.

--John
Re: BASIC recommendation? [message #3129 is a reply to message #3128] Thu, 29 June 2017 15:34 Go to previous messageGo to next message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
jcoffman wrote on Thu, 29 June 2017 13:18
Some time ago I looked at Bywater BASIC: https://sourceforge.net/projects/bwbasic/

But I forget how much of it is written in C.

--John


Interesting. It's all C and you compile it on a Linux/Mac with:

gcc -o bwbasic bw*.c -lm

Now I have to figure out what all ISO Basic is so I can do more than "Hello World". Smile

bwBASIC: list
   10 print "Hello World"
   20 goto 10

bwBasic: run


does work though!

Thanks for the pointer!



Mike
Re: BASIC recommendation? [message #3131 is a reply to message #3129] Thu, 29 June 2017 21:37 Go to previous messageGo to next message
Garth is currently offline  Garth
Messages: 29
Registered: April 2016
Location: Southern California
Junior Member
Lee Davison's EhBASIC appeared to be an outstanding BASIC for 6502 and I understand it was available for a few other processors too. The 6502 one is at http://web.archive.org/web/20120913042809/http://mycorner.no -ip.org/6502/ehbasic/index.html and also at https://github.com/jefftranter/6502/tree/master/asm/ehbasic . I have not used it myself, but I looked over the features years ago and was impressed.

http://WilsonMinesCo.com/ lots of 6502 resources
Re: BASIC recommendation? [message #3132 is a reply to message #3131] Thu, 29 June 2017 22:34 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
There is a version of EhBasic for 68000. It is written entirely in 68000 assembly and is lesser than 16k bytes. You can download the source here: http://www.easy68k.com/easy68kexamples.htm

I ran EhBasic on all of my Tinyxxx boards successfully with very little or no modifications.
Re: BASIC recommendation? [message #3133 is a reply to message #3132] Fri, 30 June 2017 22:28 Go to previous messageGo to next message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
bwBasic is a very interesting implementation. Unfortunately, it's very POSIX OS dependent. I think it'd be a major undertaking to get it to run on a bare board.

BASICs implemented in assembler don't meet my need for "something reasonably portable".

So the search continues. Unless I go with (micro)Python instead.



Mike
Re: BASIC recommendation? [message #3134 is a reply to message #3133] Sat, 01 July 2017 14:27 Go to previous messageGo to next message
Garth is currently offline  Garth
Messages: 29
Registered: April 2016
Location: Southern California
Junior Member
I'm not sure how much luck you'll have finding a portable BASIC source. I'd go for the better performance (depending on the processor) of one written in assembly anyway.

http://WilsonMinesCo.com/ lots of 6502 resources
Re: BASIC recommendation? [message #3135 is a reply to message #3134] Sat, 01 July 2017 15:02 Go to previous messageGo to next message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
Garth wrote on Sat, 01 July 2017 14:27
I'm not sure how much luck you'll have finding a portable BASIC source. I'd go for the better performance (depending on the processor) of one written in assembly anyway.


One of the platforms I'm interested in is a 240MHz ARM Cortex-M4. So performance (or space) isn't my major concern. On my 16MHz 68SEC000? Yeah, performance is more important.

But I'd prefer just one BASIC to have to learn/remember. I was just hoping BASIC would be easier to get built for the ARM than micropython. It's not looking that way. Smile



Mike

[Updated on: Sat, 01 July 2017 15:03]

Report message to a moderator

Re: BASIC recommendation? [message #3257 is a reply to message #3135] Sat, 22 July 2017 13:20 Go to previous message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
Turns out it wasn't hard to get bwBASIC running afterall. Each C source file includes "bwb_user.h", which is empty by default. One can use the C preprocessor to shadow the standard C library calls with ones for your platform, ala

#define fopen myfopen

and then define all of them to return NULL/error/EOF/... Whatever is appropriate for your platform.

I did have to make one modification to the source since I don't have kill/signal on my platform. So I added a check for the ^C interrupt flag in the main loop and call the signal handler if it's set. So I can now break out of infinite loops!

index.php?t=getfile&id=551&private=0
  • Attachment: bwBASIC.jpg
    (Size: 53.02KB, Downloaded 776 times)



Mike
Previous Topic: ECB Mini Backplane
Next Topic: CVDU - Acer V193HD


Current Time: Fri Nov 07 04:06:34 PST 2025

Total time taken to generate the page: 0.16406 seconds