Shop OBEX P1 Docs P2 Docs Learn Events
fb: my first program for the propeller — Parallax Forums

fb: my first program for the propeller

rokickirokicki Posts: 1,000
edited 2006-05-20 06:08 in Propeller 1
With all the help from Chip on this board, I've put together my first Propeller program.

It's just a joke. Maybe you'll like it. It should run on either the demo board or the
propstick, or even a homebrew as long as you can drive a TV.

Don't read the source before you run it. The top class is called fb.

After you run it, you might try to "run" it.

Of course, very little of it is new; it's just using all the demo stuff they already ship.

Enjoy!
zip
35K
fb.zip 34.6K

Comments

  • cgraceycgracey Posts: 14,133
    edited 2006-05-17 17:40
    Rokicki,

    Wow! I wouldn't have believed it if I hadn't run it!

    For those of you who haven't tried this, it's a fairly functional Tandy Color Computer from 1980! It comes up with a prompt and you can type in programs via keyboard and run them (using the Demo Board). It uses line numbers. I typed in this, and it ran:

    10 print "x";

    20 goto 10

    run

    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    I never expected to see something like this, especially so early. Rokicki, I think you must have done this enough times on enough systems that you could do it in your sleep now. I can't think of any other explanation for how you would know WHAT to do so quickly to make a Tandy CC like this.

    Please note the new efficient VGA character display I posted last night. It will free up almost half the RAM your tv_terminal is using now, plus it's WAY faster. With more memory, you could do way more.

    I can't believe you even packed in an interpreter! This thread is under-viewed!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.

    Post Edited (Chip Gracey (Parallax)) : 5/17/2006 5:45:52 PM GMT
    696 x 496 - 106K
    680 x 468 - 118K
    cc1.jpg 105.6K
    cc2.jpg 118.5K
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-05-17 17:55
    Wow I have to try that, I was convinced to give my old coco to my cousin in a vain attempt by my aunt to get him interested in computers. It never left his closet, and I found out she sold it at a yard sale for $5 while I was at college, grrr. Well now I can have it again, thanks rokicki.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-05-17 17:57
    That's amazing! Rokicki, you should have given us a hint! I'd love a VGA version with Chip's new drivers.
    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Southern Illinois University Carbondale - Electronic Systems Technologies

    Personal Links with plenty of BASIC Stamp info
    StampPlot - Graphical Data Acquisition and Control
  • rokickirokicki Posts: 1,000
    edited 2006-05-17 18:36
    Wow, I'm flattered! Of course this is *very* much only a hack (there's at least one major bug in there
    and another minor one). Before spending too much time to extend it and fix it up I'll have to think
    about where, if anywhere, it should be taken.

    The interpreter is based on the TinyBasic language: if/then, goto, gosub, rem, return, print, input,
    list, run, new, */+-, rnd(), and that's it. Integer variables A-Z only; no arrays, no for loops, no
    multi-statement lines, no strings, no floats. The interpreter is entirely my own code, although it
    follows a fairly conventional tokenized-basic design. Of course it's painfully slow being a rather
    slow interpreter interpreted by SPIN (which is pretty fast)---two levels of interpretation will get
    you.

    Although BASIC is a somewhat evil language (line numbers!), it does provide an amazing elegant
    combination of interactive read/eval/print loop, integral editing system (no full-screen editing
    needed, or even a special edit "mode"), and accessible semantics. If I were putting together a
    microcomputer today for young kids, I'm not sure what language I'd build in, but it's not clear
    how to beat BASIC for sheer accessibility.
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-05-17 19:13
    Rokicki,
    How long will it be before you have the cassette interface done so we can load and store programs to tape. I have a machine langauge monitor we can use for testing. In fact the cassette IO was done using a din plug? Chip, have you got the DIN cables left over from the Commodore that you can loan Rokicki.

    I'll be happy to beta the cassette drivers when their ready...
  • rokickirokicki Posts: 1,000
    edited 2006-05-17 19:48
    I have all the cassette cables I need---the problem is finding one of those Radio Shack cassette recorders that still works well enough.

    Indeed, one of the things on my list of projects is to build a propeller+SecureDigital card that fits inside the CoCo so that csave/cload
    (by name!) work *without* an actual attached cassette deck but otherwise the CoCo is functionally unchanged. I know this is a silly
    project, but some of the best projects are.

    It's too bad only the CoCo 3 has video output rather than RF output. Anyone know how to pull a standard 1v P-P video output out of
    a CoCo 1 or CoCo 2, bypassing the RF?
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-05-18 14:06
    Well,
    I have at least two of those cassettes recorders but they've been in storage quie awhile. I'll check, I may have a circuit diagram for the COCO NTSC output. If I find it I'll let you know.

    Oliver
  • cocokiwicocokiwi Posts: 75
    edited 2006-05-19 14:24
    rokicki said...
    I have all the cassette cables I need---the problem is finding one of those Radio Shack cassette recorders that still works well enough.

    Indeed, one of the things on my list of projects is to build a propeller+SecureDigital card that fits inside the CoCo so that csave/cload
    (by name!) work *without* an actual attached cassette deck but otherwise the CoCo is functionally unchanged. I know this is a silly
    project, but some of the best projects are.

    It's too bad only the CoCo 3 has video output rather than RF output. Anyone know how to pull a standard 1v P-P video output out of
    a CoCo 1 or CoCo 2, bypassing the RF?
    ······ Did it many times,one takes off at the location The video goes into the RF module,we used a Motorola chip to get the Composite.
    ······ same chip that is used in the RF module.scool.gif······· I have a couple around here somewhere! I,m the Manager of the OS-9/ cocosig that is STILL
    ······ on what is now Delphiforums.
    ····· ·I took over from Marty Goodman back in 93.

    ····· http://forums.delphiforums.com/cocosig/messages
    ······ now you may find this interesting! I suddenly realized you don't have a CoCo-3(Hint) I have a spare!freaked.gifsmilewinkgrin.gif
    ····· ·Analog Devices have a new chip that will NOT do what you want unless you have a Coco-3,except you will also have S-VHS.(grin)

    ······ which most TV,s have now as a external input,chip is cheep and not too hard to make a usable device!

    ······ AD 723/4/5···· 3 different versions· PDF files @·· www.analog.com···· The 723 is the simple version The 724 has extras,and the 725 is an
    ······ improved version of the 724.

    ····· Has 16 pins SOIC ....· RGB Hsync/Vsync·· Composite· Enable· S-VHS····· +5volts· a luminance TRAP filter

    ···· which consists of a 47k,IN4148,9nf and a 10nf cap,and a 68 uh choke, if· PAL one justs grounds it!

    ···· Parts list
    ··
    ···· AD 725

    ····6 x 75 ohms
    ····6 x .1uf
    ··· 3 x 220uf Electro Caps
    ··· 2 x 10uf Electro Caps
    ··· 1 x 14.318180 MHz Osc

    ··· composite RCA jack,S-VHS socket·· Small proboard

    ··· cost less than $30 to make one DIY Now one can use the high end graphics as RGB ANALOG monitors are hard to come by,since the 3 has
    ··· Composite,one don't need that on the board.


    ··· Dennis
    ···


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://people.delphiforums.com/cocokiwi/Image/picture.jpg

    Post Edited (cocokiwi) : 5/19/2006 2:29:37 PM GMT
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-20 04:50
    I love this app...
    Short and sweet...
    Neat O!
    Kinda of hard to see what you were doing without SOME comments... [noparse]:)[/noparse]

    Anyway, good show!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • AndreLAndreL Posts: 1,004
    edited 2006-05-20 05:30
    Yes, very cool, very similar to some of the stuff we are doing for the hydra, so this kinda spoils it [noparse]:([/noparse] Oh well !·Also, as noted the language is based on TinyBasic by Thomas pitman and for those interested and not compiler authors, the program is short and sweet since it does in place tokenization parsing right with the program stream without an intermediate tokenzied form and then working on a secondary data structure. A common strategy on limited memory systems, etc. the cool thing about it is that is actually makes a lot of things very short and sweet like the tokenizer (what there is of it in tinybasic) is integrated into the expression evaluator, and the line numbers become part of the program byte stream, etc. And tom definitely likes recursion, so some things look like they don't even work, but they do, if any of you have coded in LISP a required evil for your CS degrees, then you are used to code looking like it doens't do anything, but it does.

    Also, for those interested the languages we release for the hydra that are pd will be 100% massively commented, since trying to read recursive algorithms without help is really hard -- Tom is just so good at it, he probably has this pattern memorized and that's why he didn't comment it!

    Lastly,·this style of compiler/interpreter construction is well documented in The art of compiler design which is very down and dirty by the author of tinybasic, the dragon book won't show you how to do this stuff so short and elegant as tom has done in this example.

    Anyway, back to the hydra project, everything is almost done,·I am working on the book right now, the last 1/3rd of it and then everything will be ready for manufacturing. The games and demo that come with it are worth their weight in gold, well worth the wait. I am looking at a 3D pole position game right now [noparse]:)[/noparse]

    Andre'
  • Mike GreenMike Green Posts: 23,101
    edited 2006-05-20 06:08
    Very cool. Clearly, a lot of "higher level" stuff for the Propellor will have to be done in some kind of interpreted language since the memory is fairly limited (by today's standards) and Spin doesn't seem to have been developed with the idea of overlays in mind (although loading a COG with an assembly routine from external storage looks easy). I wasn't expecting to see something this quickly.
Sign In or Register to comment.