Propeller on-chip develpment
hippy
Posts: 1,981
I've finally got a Basic-come-Spin language running which interprets tokens in memory just as the retro home computers did. It supports most Spin statements and syntax except for the control structures, and although there's a way to go yet it's looking good so far ...
The question is ... How to get the code in and edit it ?
Currently I'm thinking of the retro method of each line needing a line number but would be interested in hearing what others think. I suppose it would be possible to create a WYSIWYG full screen editor, but that's a lot of work I don't really want to take on.
What would be a good way to deliver when it's finished ? As a back-end interpreter with a spec as to how the token image should be and what the tokens are and leave it to others to add more than a simple line-numbered editor ?
Dim myByteVar%(100) Dim myLongVar(100) n := 0 p := @myLongVar While n => 0 and n =< 100 myByteVar%(n) += ( long[noparse][[/noparse] $7000 + n<<2 ] ++ ) <- ( 1*2) If ( n & 1 ) Then long[noparse][[/noparse] p + n*4 ] := n End If Print n,Hex(n,8) n++ Wend
The question is ... How to get the code in and edit it ?
Currently I'm thinking of the retro method of each line needing a line number but would be interested in hearing what others think. I suppose it would be possible to create a WYSIWYG full screen editor, but that's a lot of work I don't really want to take on.
What would be a good way to deliver when it's finished ? As a back-end interpreter with a spec as to how the token image should be and what the tokens are and leave it to others to add more than a simple line-numbered editor ?
Comments
awesome! Would this code be helpful?
http://forums.parallax.com/showthread.php?p=714097
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with the Protoboard? - Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card? - PropDOS
A Living Propeller FAQ - The Propeller Wiki
(Got the Knowledge? Got a Moment? Add something today!)
Looks very VB ... line editor on board and a VB like GUI on the desktop and you begin opening a big market.
All you need after that is Form1 and Windows like GUI widgets [noparse]:)[/noparse] Have you considered plug-ins ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley
Traffic is slow at times, but Parallax orders·always get here fast 8)
@ Jazzed : No plans for plug-ins, but then I had no plans to do this at all ! It all evolved from modelling how best to implement "++var[noparse][[/noparse]expr]--" etc for a non-Prop compiler upgrade I'm looking at, and ...
@ Rayman : This is really for fun so in no way meant to challenge the Prop II on-chip IDE, nor FemtoBasic either. I was just planning on getting the core language working from pre-built token images first and adding a simple line-based editor and throwing it into the wild for anyone who finds it useful or is in anyway interested in the way I write my interpreters.
And if nothing else I can now appreciate the enthusiasm people have for retro systems and implementing the same on the Prop. Not sure what use it will have, but build it and they'll come, or not - I don't really care, the Propeller's so much fun to just play with and try out ideas on. That 'F10 Load to RAM and run' and Video Out are the two best features of the Propeller IMHO.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley
Traffic is slow at times, but Parallax orders·always get here fast 8)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Michael Park
PS, BTW, and FYI:
To search the forum, use search.parallax.com (do not use the Search button).
Check out the Propeller Wiki: propeller.wikispaces.com/
Set the CLKFREQ/XINFREQ and TV_PIN connect a TV and watch the little man in the Propller play retro-computing
I want to get the core done, then write the editor part and then I can do more easy debugging by typing in programs rather than editing the tokens at the top of the program. I'm going to add a via PropPlug interface so it can be used with a terminal emulator.
It's got a bit bloated. I'll split the code into core, file/stream handling, advanced, esoteric sections etc so it's easy to cull bits out to reduce size. It doesn't matter too much as a reference design as code is easier to take out than add, and a small user code area doesn't matter ( there's still ~20KB free at present ).
@ mpark : No, it's a pure interpreter of the type where each typed word ( eg PRINT, GOTO ) is held as an individual token. More like Basic Stamp PBASIC than Spin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley
Traffic is slow at times, but Parallax orders·always get here fast 8)
No command line yet ( it's a dummy echo loop ) nor code editing. Input can come from keyboard or PropPlug, output to TV plus PropPlug - 19200,N,8,1.
Variable storage is faked so don't expect more than one variable to work. Most Spin expression constructs accepted, byte[noparse]/noparse, word[noparse]/noparse, long[noparse]/noparse, prefix and postfix operators ( except '?' random - use the 'RND' variable for random numbers ), .byte, etc type modifiers plus a few of my own added, variables are long by default, var& is 16-bit, var% is 8-bit.
Supports 'var+=expr' and so on. Allows Basic or Spin, so "=" is ":=" or "==" as applicable and vice versa, "=<" and "<=" are the same ( No 'var=<=expr' etc supported ). Mutliple 'a:=b:=c' or assignments within expressions not supported ( and likely won't be ).
Probably still plenty of bugs to hunt down but it's on its way, and user program storage is diminishing by the bucket load ...
Edited : version 006 hasn't got the editing bugs ... BUT ... issue a RUN before trying to do any editing or it will crash ...
Post Edited (hippy) : 4/25/2008 8:50:06 AM GMT
I thought I'd opened a live file from the PropTool recent files list but it turned out to be a file from my backup directory, so all the edits were lost when I copied what I thought was the latest working version over the actually working backup. Ho hum.
Anyway, back on track now, with all the edits re-applied. Not finished, but working and definitely more stable ...