Menu

How to place data array in flash and use it indirect?

Petr
2023-06-14
2023-06-14
  • Petr

    Petr - 2023-06-14

    Hi,
    Is it possible?

    Example:

    Data: "string",word,pointer to function ....
    .....
    asm:
    LPM[Z]
    ...
    Call [Z]

    Other compilers kill data and functions as not used or not able to place data in code.

    Thank You!

    P.S.: Sorry for my bad English )

     
  • Anobium

    Anobium - 2023-06-14

    I am not understanding what you are asking. Do not worry about the grammar - mine is dreadful

     
  • Petr

    Petr - 2023-06-14

    I want make menu. In ASM it easy.

    Menu: <- data in code section (flash memory)
    DB "menu1",Submenu1,0
    DB "menu2",Submenu2,Function
    ....
    mov Z,Menu
    call[Z+10]

    MicroBasic example:
    structure item_t
    dim name as char[4]
    dim mm as word
    dim func as word
    end structure

    const menu as item_t = ("123"+"¿",1,@func1) code
    const menu1 as item_t = ("234"+"¿",1,@func1) code
    const menu2 as item_t = ("345"+"¿",1,@func1) code
    const submenu1 as item_t = ("sub"+"¿",1,@func1) code

    BUT
    const menu123 as item_t[2]=(menu1,menu2) <- compiler error, can't organize array

    And MicroBasic eliminate const's without direct access to it (example, var=menu1)

    Can't find flexible compiler/lang (as ASM)

     

    Last edit: Petr 2023-06-14
  • Anobium

    Anobium - 2023-06-14

    Then, I would use asm. See ASM and #RAWASM

     
    • Petr

      Petr - 2023-06-14

      Thanks, I'll look

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.