Cliff Hacks Things.

Sunday, February 10, 2008

PropellerForth tidbit: running a word at boot time

By default, PropellerForth v8.01 starts up by running the built-in word INTERACTIVE. This displays the version screen, enables multitasking, and drops into the Forth interpreter by calling the standard word QUIT.

Once you've built an application and burned it to EEPROM using savemem, you may not want PropellerForth to be interactive anymore! Alternatively, you might define a new version of INTERACTIVE that does some additional setup -- SD card initialization, for example -- and then calls the old INTERACTIVE.

I neglected to provide an easy way to run your own words on boot in v8.01, so here it is:

decimal
\ The address of a variable containing the first word to run.
140 constant 'boot

\ Sets a word to run at startup.
\ Example: BOOT MYSTARTUP
: boot ( "name" -- )
' 'boot ! ;


You can simulate a reboot -- assuming you haven't started any other tasks -- by invoking an arcane Propeller machine instruction:

32 0 coginit


Once you're satisfied, savemem and reboot!

Labels:

8 Comments:

  • Thanks for PropellorForth. I have just obtained a Propellor Prototype board, installed PropForth, written the standard led-flashing application, saved it to EEPROM and set it to run at startup. Total time taken: about 3 hours, starting from zero knowledge of the Propellor.

    Any indication of when you will be able to release the source code? We out here really do not mind what shape it is in. We might even be able to help whip it into shape...

    By Blogger Kandis, at 2:58 PM  

  • Cliff,

    I've enjoyed using PropellerForth, and have used it for some lab work w/ JTAG for ARMs, etc.

    I noticed that your generated code for OF is non-standard in that it does not drop the CASE value when it matches, letting it get dropped by the ENDCASE. This makes my code different for things between gforth and PropellferForth.

    What I've done in my Forths is to have OF generate a (OF),offset sequence, like a 0BRANCH. The (OF) code does the compare, and either drops the value or branches. This results in shorter code sequences and handles the semantics.

    BTW, I also generate calls to dummy (BEGIN), (CASE), etc., for debugging and ease in decompilation.

    Thanks for a great implementation!

    HigJJump

    By Blogger HighJump, at 10:26 AM  

  • This Blog is going places, the people, the layout, amazing to see such dedication and focus.
    Hotpoint WMD962G

    By Blogger biditcheap, at 9:26 AM  

  • The academic responsibilities placed upon a student tend to eat up all available time. Assignments, given throughout one’s academic journey, usually come up with tight deadlines. Meeting these deadlines can place a significant burden on a student’s shoulder. Additionally, other obligations like exams, mid-terms, tests and part-time jobs can leave little time for any leisure activities. All this adds up to a student’s stress levels. Fortunately, students can alleviate some of that stress by handing over the task of completing assignments to literature review service like ABC Essays.

    By Blogger Jason Daniel, at 3:36 AM  

  • I really love to do my favorite things. It gives me pleasure. What definitely does not make me happy is the writing of different essays. I can't write them. I always use a site exclusive paper where you can find essays on any topic.

    By Blogger Dakota Leest, at 5:19 AM  

  • Student's life can be very hectic, work keeps on getting piled up. So to save time, you decide to order your essay online. Here is a reliable source to do it. Everyone knows that a good education is very important. But time is of great value as well. https://essayelites.com/write-my-extended-essay/

    By Blogger Olly, at 2:07 AM  

  • Ensuring seamless operation is crucial for system performance. Integrating a reliable dissertation writing service at boot time enhances efficiency, guaranteeing a smooth start for academic tasks. Optimize your workflow with this invaluable addition.

    By Blogger unknown, at 11:47 PM  

  • Delving into the intricacies of Propeller Forth is fascinating! Running a word at boot time adds another layer of complexity. Much like the precision needed in coding, students navigating technical subjects can seek clarity through expert guidance from services like UK Assignment Help, ensuring a smooth academic journey and success in their endeavors.






    By Blogger James Parker, at 5:26 AM  

Post a Comment

<< Home