Menu

FlashForth 5 for ATMEGA 328p

2020-04-12
2020-04-16
  • Radolf von Salis

    Dear Mikael,
    thank you for the information. In a few days I will have a compilation of all FlashForth5 words for Atmega 328p with a lot of examples on more than 30 pages. Unfortunately in German-language. I will then attach a pdf.
    BR Radolf

     
  • Radolf von Salis

    Hi Mikael,
    I have some problems with the ff5-Words :noname and is . Can you give me a hint to the application of this 2 words?
    I made this:
    vektor create cells allot does> swap cells + ;
    3 vektor questo
    nn questo @ execute ;

    :noname ." zero" ; 0 questo !
    :noname ." uno" ; 1 questo !
    :noname ." due" ; 2 questo !

    When I say 0 nn I get the answer "zero" 1 nn gives "uno" and 2 nn gives "due, but 3 nn > good bye!
    I think that the word is makes somethink like this, but with more elegance and more security.
    BR Radolf

     
  • Radolf von Salis

    the editor for communications in sourceforge is not so good. See the attachement!

     
  • Mikael Nordman

    Mikael Nordman - 2020-04-15

    See this thread. It explains :noname and is.
    https://sourceforge.net/p/flashforth/discussion/726813/thread/82c44761fe/

    If you look at formatting help, the little reverse question mark, there are some tags to format code better. It can even highlite forth code.

    ::::Forth
    vektor create cells allot does> swap cells + ;
        3 vektor questo
            nn questo @ execute ;
    
        :noname ." zero" ; 0 questo !
        :noname ." uno" ; 1 questo !
        :noname ." due" ; 2 questo !
    
     
  • Simon Bridger

    Simon Bridger - 2020-04-15

    How does it format Forth. Is there a def file somewhere in SF, or is it something you have added to this SF project?

     
    • Mikael Nordman

      Mikael Nordman - 2020-04-16

      Just insert a code block.
      Then write :::forth on the first line. If you don't do that, markdown tries to automatically detect the language.
      If you read the Formatting Help, it has all the details.

       

      Last edit: Mikael Nordman 2020-04-16
  • Radolf von Salis

    Hi Mikael,
    thank you for the hint. In the attachement you can see the example I'm going to use in my work.
    My last questions for you is about the use of the words .id and cf,
    BR Radolf

     
    • Mikael Nordman

      Mikael Nordman - 2020-04-16

      .id is used to print a word name from the dictionary,

      :::forth
      ' ' c>n .id ' ok<#,ram> 
      ' key c>n .id key ok<#,ram> 
      

      cf, compiles call or rcall to the given address.

      :::forth
      : testing [ ' true cf, ] true false ;  ok<$,ram> 
      see testing 
      3fa8 940f f6a4 call  true
      3fac 940f f6a4 call  true
      3fb0 940d f69b jmp   false
       ok<$,ram> 
      testing  ok<$,ram> ffff ffff 0 
      

      BR Mikael

       
  • Radolf von Salis

    Hi Simon,
    see attachement!
    BR Radolf

     

Log in to post a comment.