FemtoBasic for Hydra
Mike Green
Posts: 23,101
Brian asked that I post this on the Hydra forum as well. The source will compile for either the Demo Board or the Hydra with a change in one constant near the beginning. I've included both binaries in the archive for convenience. Any future changes I'll just post in the main Propeller forum rather than always doing duplicate posts.
Mike
Mike
zip
60K
Comments
I was able to write some minimal programs without even reading the RTF [noparse]:)[/noparse]
One question though, is there a way to delete a single line? For example, I was playing around and typed 8888 / (meaningless) and I couldn't get rid of it without starting over.
I would recommend that you find a single upload location and keep the current version there. Maybe SourceForge?
It can get a little hard to keep up with all the changes when you're attaching new versions throughout the thread. Just a thought.
Thanks for the update,
Rich
If not, that sounds like a bug [noparse]:)[/noparse]
Andre'
Fred2
There's already a PEEK/POKE like operation, but based on Spin and allowing for the different size items (byte, word, long word). They're BYTE, WORD, and LONG and are always followed by an address in square brackets like "BYTE[noparse][[/noparse]x]". These can occur in expressions for a PEEK function or can occur on the left side of "=" for a POKE function.
One of my fascinations with Basic was being able to do PEEKS and POKES.
This will open all kinds of fun things...
Fred2
Andre'
"...One thing I used to like to do with the Atari 800 is create a controlled "virus", I would set up a tile graphics mode and then scroll thru memory and "watch" data move around..." Sounds like a hacking method
I have used on the PC. Actually, when Windows 95 came along that's the same method I used to find out where the COM ports had been re-mapped to. Understanding, the mapping offset allowed an EXE or COM
program to “test” this condition and determine if you were running in DOS or Windows mode. Visualizing "Live" Memory is an excellent debugging tool that can be used toward many other applications.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Andre'
to learn SPIN.· I am having trouble· with assigning ASCII characters to variables, whenever I
enter something like c="X", I get a "Missing closing quote" error.· I tried ending the quote with
a number of ", but I still get the error.· Is there any workaround to get ASCII characters into
variables?
I am having a lot of fun with FemtoBasic, it is a great application!!!
Fred2
I often use quoted character values in my FemtoBasic programs and don't get an error. Could you post the rest of the code that's giving the error? What version does FemtoBasic display when it starts up? There was an earlier version that had some problems with quoted strings. The one posted here is 1.043.
Mike
I have reloaded a fresh copy and I do not get the "missing closing quote" error. I can enter c="A" and
it accepts with "OK". Then if I type "print c" I get "65". I tried c$="A" and I get "Syntax Error".
If it is printing the ASCII value, shouldn't it be 61 instead of 65?
Otherwise the Basic is great! I am fooling around with writing a memory dump.
I will rustle through my files and get my copy of DDJ with the Tiny Basic article and review the specs.
And I will download the newer posting.
fred2
There are no string variables in FemtoBasic (with "$" after the name), only the 26 letters which are 32-bit integer variables. You're getting the syntax error because of the "$".
The value of "A" is indeed 65. "@" is 64 and the uppercase letters start next.
This version includes a memory dump (DUMP <address>,<length>).
Mike
It brings back memories of the tiny basic I used with my KIM1!
I have just one question, and a suggestion.
1) is there no PAL version of the tile based TV driver yet? Not that is immediately needed because I don't see how you can change the display color anyway, except maybe by using the Byte[noparse][[/noparse]x] (etc) command, or by using SPIN. But maybe the next FemtoBasic can have a color statement
2) A cursor would be nice.
Ill start studying the source code of femtobasic, maybe I can write a cursor routine.
Mahjongg
2) A cursor for the TV driver is on my list. I'll be switching to the VGA tiled driver in the next release since it's compatible with the TV driver and can do tiled graphics like the TV driver and the VGA tiled driver has cursor support. I plan to add the same to the TV driver. It'll take a while. I've also got mouse support on the list ... integrated into the existing keyboard driver so it won't need another cog.
All of this is in preparation for another release of the Propeller OS which is essentially the same I/O as used in FemtoBasic with a simple command interpreter instead of the FemtoBasic interpreter.
It works fine now. I can't believe I read over the tv_params table, I was looking for it and it's exactly where I expected it to be.
FemtoBasic is just the eight program or so I tried, and in most of the other demo's I did find the tv_params table, and could change it to display PAL.
That said, PAL works now, but the letters are much smaller than in NTSC mode, and the picture is a bit wavy and unstable. Perhaps it's a limitation in the PAL system, or maybe the parameters in TV.SPIN are not 100% OK. I tried, but It's not solvable with the tv_parameters, (I found the meaning of these in the TV.SPIN source). I took a long look at TV.SPIN to see what the problem could be, but for the moment that program is still over my head.
The ANSII like escape codes work fine too.
DISPLAY 7,12 gives black letters on a green background, reminiscent to the old Tandy color computer (and Dragon32 etc), but with a much nicer font.
Regarding the cursor, ok if the cursor support will be available in the next "tiled VGA driver", then its not necessary for me to try to create one myself. I take it the cursor can be turned off when not needed (while running a program).
Which VGA driver are you talking about, I only see three in my propeller tool library (v0.98.1), and none of them seems to also support composite video.
What use will a mouse have for FemtoBasic? Will you only be able to read x,y offsets and key codes? Without any graphics support I don't see the use for it at the moment. Except maybe to highlight text.
What do you mean by the Propeller OS, do you mean you are going to build FemtoBasic on top of a small OS you will write, or does a Propeller OS already exist.
Sorry that your answers only lead to more questions , but it's fun to learn something new.
Mahjongg
2) The mouse would be optional and would provide the same information that the current mouse driver provides. I think there's room in the cog to add the mouse code and it would be nice for control. As long as the cursor works even with a pure text display, it could be used for controlling text buttons.
3) The Propeller OS is another project to provide a basic set of integrated I/O drivers (for keyboard, TV or VGA display, optional mouse, and I2C/SPI I/O with a boot loading capability) along with a simple command interpreter to run programs off mass storage (EEPROM or SD card) as well as some basic utility functions (like copy/delete programs). It's really the same underlying I/O routines with a little "window dressing". The other idea behind this is, once the I/O routines are loaded into their cogs, the assembly stuff doesn't need to be around any more. When other programs are overlaid, there may be another 6K or more of space available.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
Are you considering re-writing the basic in ASM? It's double interrpretted at this point. It would be quite a bit of work, but worth it. I guess you can wait for the C compiler to get finished and then compile it in that, but that might be a long time.
Andre'
I actually started writing a Parallax Basic variant to Large Memory Model compiler in Spin. It'll have to be a multi-phase compiler and the SD card routines need to be improved so that multiple files can be opened and random access is supported (to be used for the compiler files). I've gotten busier with other facets of my life, so progress is slow.