Missing FastSpin C library functions
David Betz
Posts: 14,516
in Propeller 2
Any chance these could be added sometime soon?
/Users/dbetz/Dropbox/work/junkbasic/edit.c:57: error: unknown identifier strcasecmp used in function call /Users/dbetz/Dropbox/work/junkbasic/system.c:68: error: unknown identifier vsprintf used in function call
Comments
No, it's just using too many registers. It looks like you're compiling for P1. Does it work if you add "-2" to the command line to compile for P2? That'll use less COG memory. Alternatively, you could try setting "--fcache=0" to remove the fcache.
It is not anywhere near done though but you can build and run it by typing "make run-p2". You should be able to type lines of BASIC (starting with line numbers) and type "LIST" or "RUN". If you try running the program all that happens is that it gets parsed and the resulting parse tree is printed.
There's not really a cooked mode yet. In fact all the stdio code is under heavy development (as you've probably noticed).
Looks like you've made a good start to your BASIC!
Thank you, but I really can't take credit for all of that. The C library functions largely come from PropGCC, which many people (including you!) worked on. @"Roy Eltham" has done great work porting the simpletools libraries (originally written by Andy @ Parallax, IIRC) to the P2 and FlexC. @JRoark contributed a bunch of BASIC libraries, and @avsa242, @dgately, @yeti, and many others have contributed bug fixes and suggestions. Like any successful project, fastspin is a community effort, and I'm always happy to get pull requests for it. There's still a lot of work to be done to improve the compiler and libraries!
Funny how I do a lot of C++ programming, but do it with MFC, so know almost nothing about basic C libraries...
system.c is the interface to the underlying system. Mostly they have terminal I/O functions and memory allocation.
I have the Edition 1 book, which doesn't use... ...but I am adding it to the listings.
First program (hello.c)... perfect. The second program (Fahrenheit to Celsius table) works, but seems to show a bug in printf() on the P2. I opened the file in Geany and compiled it there -- the output is as intended.
I don't know if this is worth fixing, but thought I'd point it out. In the attached image, the FlexGUI terminal is on the left, the Geany terminal on the right.
This is why having lots of people try the tools is so useful... printf of floats with no trailing digits just hadn't come up yet, and I think I misread what the spec said about that case. Thanks!
Eric
I'm not a retro computer guy, but watching all the interviews with BK on C and Unix makes me wonder if one of those old versions of Unix -- with proper hardware drivers -- would run on the P2. It would be kind of neat to experience Unix as they did in the late 70s/early 80s running on a P2 with a terminal output and the SD card for files. I suppose if someone could find an old dot-matrix printer, there are enough pins to drive that as well.
I have no experiences with most of the systems there, just explored a bit B on Unics.