Shop OBEX P1 Docs P2 Docs Learn Events
PropBASIC (Preliminary Examples) - Page 2 — Parallax Forums

PropBASIC (Preliminary Examples)

2

Comments

  • BeanBean Posts: 8,129
    edited 2009-08-30 15:12
    SRLM,
    Eventually it will be the CODE that is in the HUB, when we move to LMM.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...


    ·
  • $WMc%$WMc% Posts: 1,884
    edited 2009-08-31 03:00
    Bean

    I'm so excited!!!!!
    A Propeller/Basic compiler.

    If I can be of any help. Just PM me.

    _______$WMc%____

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • HumanoidoHumanoido Posts: 5,770
    edited 2009-08-31 06:41
    Considering the WYSIWYG stage of the code,
    can u release a tiny version for experimenting
    and fun?

    humanoido
  • Agent420Agent420 Posts: 439
    edited 2009-08-31 11:17
    $WMc% said...
    Bean (Hitt Consulting)
    Forum Moderator


    My only problem with all of this is with Prop/ASM.
    It just takes way to much code for me to write/use.
    I quickly loose interest and return to my little favorites the BS2s
    I would have thought that Spin would be easy enough for individuals transitioning from Basic?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • BeanBean Posts: 8,129
    edited 2009-08-31 11:31
    Agent420,
    That is true, but even use LMM PropBASIC will be hundreds of times faster than spin. (No disrespect to spin).
    Also spin does not support GOTO which will cause frustration for BASIC users from the Stamps.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...


    ·
  • $WMc%$WMc% Posts: 1,884
    edited 2009-09-01 03:53
    Agent420

    My point is I don't want to leave Basic. If all the code is compiled down to ASM/PASM why not make it code friendly. A $BASIC% compiler, A JAVA compiler ,or A C++ compiler. For the Prop.

    I can spend My preciouses time learning a new language. or I can spend my time doing something productive, like making a usable project, The productive part is using a code I already know, "BASIC" I started learning BASIC back in 1985.


    ________$WMc%________

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • Agent420Agent420 Posts: 439
    edited 2009-09-01 11:56
    One of the nice things that makes embedded Basic easier for the programmer is that it offers·some more complex operations such us Print, LCD commands, I2c, serial etc etc simply wrapped up as internal commands without having to 'Include' libraries or objects.

    I'm curious how you plan to handle these things on the Prop...· Will the compiler automatically start a new cog dedicated to these type of tasks?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • WurlitzerWurlitzer Posts: 237
    edited 2009-09-01 12:12
    As I am sure you know another lesser brand "X" micro uses a subset of VB6. The IDE for VB6 is so nice to use and with the possibility to compile Basic code to the Prop would be a real plus.

    For pure raw speed I will still use PASM but that is simply using the proper tool for the job.

    Thanks for all your effort.
  • dMajodMajo Posts: 855
    edited 2009-09-01 15:45
    Wurlitzer said...
    As I am sure you know another lesser brand "X" micro uses a subset of VB6. The IDE for VB6 is so nice to use and with the possibility to compile Basic code to the Prop would be a real plus.

    For pure raw speed I will still use PASM but that is simply using the proper tool for the job.

    Thanks for all your effort.
    Write clearly: it's the BasicX tongue.gif and its X01 version have a really nice network feature

    attachment.php?attachmentid=73609attachment.php?attachmentid=73610

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · Propeller Object Exchange (last Publications / Updates)
  • technoweaseltechnoweasel Posts: 10
    edited 2009-09-01 20:24
    I'm still working on it. I have it to a level where variables can be declared and pins set high/low. However, I have decided to restructure the program with a new idea I have. School is starting, so I don't know how much I will work on it, but I'll try. I have a lot of trouble FINISHING projects, but this time I am determined to prove that I can actually complete something. Competition might actually help me achieve that.

    I renamed it "TALOS-B," for no particular reason. I understand about the naming conflict. We probably both used it because it is very obvious. It's my fault for procrastinating and not working on it. [noparse][[/noparse]I actually started it months ago, but only wrote about a hundred lines.]

    My greatest problem, so far, is that I am unfamiliar with Propeller programming. Before this I never wrote even one line of asm. I spent 10 minutes trying to light an led in assembly!·I also couldn't figure out why Bean had to declare constants over 511, until the Propellent started to return errors, that is. I am pretty good with C, but pasm is vary frustrating.

    I need some help: I want to make a command like "Sleep ms" that uses waitcnt to pause for ms milliseconds. I have been looking through the manual examples, but I can't get anything to work. If anyone would like to assist, please feel free.

    I will not release anything until it has enough features to produce programs worth testing, so you can expect a wait.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people in the world, those who understand binary and those who don't.·· -a poster I saw
  • technoweaseltechnoweasel Posts: 10
    edited 2009-09-01 21:04
    Me again. I can't believe how many people have already talked about this compiler idea. I wanted to try it because I thought it hadn't been done, but now I see that you guys have been busy making the prop use all kinds of languages, translating code, building little computers, etc.

    What is LMM? I did a forum search, but it didn't say much. Does that mean "large memory model?" How is that different from regular pasm?

    How could code be read from main memory and then executed without an interpreter?

    Sorry if I'm stealing your thread, Bean. I really don't mean to, and I will try to·stop asking questions that are not related to you project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people in the world, those who understand binary and those who don't.·· -a poster I saw
  • doggiedocdoggiedoc Posts: 2,245
    edited 2009-10-12 02:52
    @Bean - Kudos on the effort. It'll be well received.


    @technweasel - I guess I'll have to change my signature. tongue.gif I have it on a T-shirt. It's one of my favorites!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people in the world, those that understand binary and those that don't.
  • BeanBean Posts: 8,129
    edited 2009-10-14 17:40
    I want to let you guys know that PropBASIC is moving forward.

    I don't want to create any undue excitement (no questions about when it will be released, I don't know either).

    The development is very much in a state of flux as we try different things to see how they work, so don't rely on anything in this example to stay the way it is.

    We are trying to stay true to the SX/B style, so anyone who is familiar with SX/B will be up and working right away.

    But I did want to show you all how the compiler is coming together, I have attached a demo program that uses multiple cogs to perform some functions. The functions are written as TASKs (as in SX/B). Except that these tasks run at full speed in a seperate cog. The whole program is in one source file. But creates three .spin file (this is just how the propeller IDE likes to handle this kind of stuff).

    If you load the test.spin into the Propeller demo board, you will see the leds flashing. And If you start the Parallax serial terminal it will echo the characters that you type (don't type too fast, as it is not buffered for this simple demo).

    Anyway, comments are welcome, but please nothing about how "you" would do it. It could very well change tomorrow anyway.

    Enjoy,
    · Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-10-14 18:26
    Hi Bean,

    In test.spin

    CON
      led_ofs                          = 0
      serChar_ofs                      = 2
    

    DAT
    __DATASTART
    led              BYTE 255
    serChar          WORD 256
    

    Shouldn't serchar_ofs be 1 ?

    regards peter
  • BeanBean Posts: 8,129
    edited 2009-10-14 18:36
    Peter,
    No. WORD and LONG hub variables MUST fall on WORD/LONG address boundaries. So the byte between "led" and "serChar" is wasted.
    If serChar had been a LONG, there would be 3 wasted bytes. and serChar_ofs would be 4.

    This is just one of the many little "gotcha" details that the compiler will handle for the users.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...




    Post Edited (Bean (Hitt Consulting)) : 10/14/2009 6:48:10 PM GMT
  • BeanBean Posts: 8,129
    edited 2009-10-15 01:54
    Here is another example program.
    This one is a simple NTSC video driver (256x192 monochome).

    Load the "video.spin" file into the propeller IDE and run it.
    Then comment out the instructions that make-up the PAUSEUS 50 (lines 116 thru 121) and run it again to get an idea of the speed of the compiled code.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-10-15 03:31
    Bean, that code is a true work of art. It reads logically, it is clean and simple, plus it works!

    It looks like you have a lot of instructions already. Are there any that are proving difficult?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/build
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-10-15 04:19
    Very cool - well done!
    Bean (Hitt Consulting) said...
    Here is another example program.
    This one is a simple NTSC video driver (256x192 monochome).



    Load the "video.spin" file into the propeller IDE and run it.

    Then comment out the instructions that make-up the PAUSEUS 50 (lines 116 thru 121) and run it again to get an idea of the speed of the compiled code.



    Bean.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • mparkmpark Posts: 1,305
    edited 2009-10-15 07:08
    You know, it kind of kills me that the first PASM compiler is *gack* BASIC!

    But seriously, amazing progress.
  • BaggersBaggers Posts: 3,019
    edited 2009-10-15 09:06
    Bean amazing progress like mpark says.

    I'm sure this will help bring a lot more stamp users to the prop [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • BeanBean Posts: 8,129
    edited 2009-10-15 11:11
    Baggers said...
    Bean amazing progress like mpark says.

    I'm sure this will help bring a lot more stamp users to the prop [noparse]:)[/noparse]
    Thanks, that is the goal. Plus make it easy for SX/B users to switch to the Propeller too.
    I will sorely miss the good ole SX when it is gone. (sniff).

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...


    ·
  • BeanBean Posts: 8,129
    edited 2009-10-15 11:20
    Dr_Acula said...
    Bean, that code is a true work of art. It reads logically, it is clean and simple, plus it works!

    It looks like you have a lot of instructions already. Are there any that are proving difficult?

    So far the hardest thing has been to get multiple cogs going. I tried several implementations before this one. But I really like the way TASKs work. Everything is in one source file. And all the HUB variables are common to all TASKs.

    Still to implement is commands to use the hardware counters. I don't see too much problems there.

    There are still various bugs that need fixed. For example I tried to do:

    ·__param1 = 1 << __param1

    And it generated:

    mov __param1,#1
    shl __param1,__param1

    Now THAT is not going to work. It's just little things like this that would give someone who doesn't know PASM a real problem. So there is LOTS of testing that needs to be·done, but only after everything (well most everything) is implemented.

    When I did the video demo the first time I didn't think I would need the delay (PAUSEUS 50).·There are some 49,000 pixels to fill the screen, and the XPlot routine has some HUB instructions, but the code was alot faster than I thought it would be.

    Bean.

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...


    ·
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-15 12:11
    Bean, Great work smile.gif

    BTW, the answer in your signature is ambiguous, LOL· And you missed Octal, if anyone remembers what that was - cannot remember the prefix tho'.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-10-15 19:00
    You could carry on, up to the base 65 (decimal) but the joke may tend to become tedious. You would have to have two friends for the fingers and toes counting.

    Thats why I have to stick with decimal, Hey-Ho.

    Bean, when the prog is finished how will it be released ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • BeanBean Posts: 8,129
    edited 2009-10-16 18:17
    We are hoping to have the PropBASIC compiler integrated into the Propeller IDE. But that is not a sure bet yet.

    Here is another example that uses the Propeller Demo board's Microphone and LEDs to make a simple sound meter.

    Bean.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-10-17 03:25
    Bean, your demo's are very impressive. I am not planning to release demos for a while yet.

    We are taking different approaches, and will end up with quite different compilers - and I don't know who will end up in the IDE.

    It could be your PropBASIC, it could be my PropellerBasic, or it could be another effort that we may not know anything about.

    One thing I am pretty sure of: Propeller, SX and Stamp users will all win.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • BeanBean Posts: 8,129
    edited 2009-10-17 15:02
    Thanks Bill,
    One goal of PropBASIC (as with SX/B) is to teach assembly language. So the language is somewhat limiting (only a single expression per assignment, etc). And because we had the SX/B source to use as a starting point, we are making good progress.

    I sincerly hope that Propeller users will have both of our compilers to choose from. I'm sure they will be quite different, and each will have it's place.

    As I mentioned before, the hardest part has been getting code that runs on multiple cogs. I don't know if you have worked thru that problem yet or not.

    I can't wait to see some demo from PropellerBASIC.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...


    ·
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-10-17 15:11
    This will be the first time in computing history when BASIC will be stronger than the product's native language.

    Love it!

    Looks like a great bridge for the SX users who will be looking for a new home soon!

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-10-17 20:01
    Thanks Bean,

    I dusted off my old preliminary code from '06/7 when I started working on PropellerBasic, and have been fixing/improving it and adding features.

    The biggest mess was the expression evaluator, which worked *most* of the time - the problem being the odd times when it did something really weird with register allocation. I've been re-writing that. FOR/NEXT, DO/WHILE, IF/THEN/ELSE, GOTO/GOSUB were a piece of cake by comparison.

    I agree, our compilers will be quite different, and addressing different market segments - and choice is good smile.gif

    I'll be very happy to get yours - and everyone's - feedback on demo's; I am hoping to release some probably start of December - I want most multi-legged creatures thoroughly squashed before any public showing.

    From what I've seen of your demo's, SX/B users will feel right at home with your compiler [noparse]:)[/noparse] mine will have a slightly different feel, as I started from a different code base, and I am using a top-down approach, however it will not be too different from a Basic users point of view. I'm addressing starting multiple cogs by using COGNEW - I am not trying to make it fit any existing basic Thread/Task model at this time, perhaps later.

    Best,

    Bill
    Bean (Hitt Consulting) said...
    Thanks Bill,
    One goal of PropBASIC (as with SX/B) is to teach assembly language. So the language is somewhat limiting (only a single expression per assignment, etc). And because we had the SX/B source to use as a starting point, we are making good progress.

    I sincerly hope that Propeller users will have both of our compilers to choose from. I'm sure they will be quite different, and each will have it's place.

    As I mentioned before, the hardest part has been getting code that runs on multiple cogs. I don't know if you have worked thru that problem yet or not.

    I can't wait to see some demo from PropellerBASIC.

    Bean.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • BeanBean Posts: 8,129
    edited 2009-10-24 15:04
    Here is a program that receives serial data and displays it on a NTSC monitor.
    It has a 64x24 character black and white display.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...
Sign In or Register to comment.