Skip to main content
Visitor II
July 6, 2007
Question

Skip-jump table with Cosmic

  • July 6, 2007
  • 7 replies
  • 1271 views
Posted on July 06, 2007 at 07:38

Skip-jump table with Cosmic

    This topic has been closed for replies.

    7 replies

    henrik2Author
    Visitor II
    July 3, 2007
    Posted on July 03, 2007 at 14:25

    Hi, I'm trying to make a skip-jump table for my IAP application. I have read all the previous threads here but still cant get it to work. Are there anyone who can support me with some code?

    Regards

    henke

    Visitor II
    July 4, 2007
    Posted on July 04, 2007 at 06:38

    Hello,

    there's a code example in

    http://www.stmcu.com/forums-cat-2946-1.html

    Does it suit your needs?

    Regards,

    Luca (Cosmic)

    henrik2Author
    Visitor II
    July 4, 2007
    Posted on July 04, 2007 at 06:44

    Hi,

    I have tried that code and I get error from compiler:

    ''redeclared external INT_jump_table''

    Regards

    Henke

    Visitor II
    July 4, 2007
    Posted on July 04, 2007 at 14:57

    that error is rather self-explanatory... are you sure you have put the different part of the example in the different source files as required?

    Regards,

    Luca

    henrik2Author
    Visitor II
    July 5, 2007
    Posted on July 05, 2007 at 06:55

    Hello Luca!

    Oh, sorry. I see what you mean now. But I cant get it to work anyhow.

    interrupt_vector.c:

    -----------------------------

    extern char INT_jump_table[];

    char * const _vectab[] = {

    INT_jump_table,

    INT_jump_table+3,

    INT_jump_table+6,

    };

    -----------------------------

    jump_table.c

    -----------------------------

    #pragma section (INT_JMP)

    char INT_jump_table()

    {

    #asm

    xref _irq_trap;

    jp _irq_trap

    jp _irq_trap

    jp _irq_trap

    #endasm

    }

    #pragma section ()

    @interrupt void irq_trap (void)

    {

    }

    -----------------------------

    Now I get this message from compiler:

    ''bad address (0x1000) for zero page symbol _INT_jump_table''

    Thanks in advance, I really need your help on this...

    Regards

    Henke

    Visitor II
    July 5, 2007
    Posted on July 05, 2007 at 13:10

    send me your project at

    mailto:luca.ubiali@cosmic.fr

    and I'll take a look at it.

    Regards,

    luca

    Visitor II
    July 6, 2007
    Posted on July 06, 2007 at 07:38

    in case someone other than the OP was following this thread, the problem came from the fact that the memory model used put variables @tiny by default. The solution was to add @near in the line

    extern @near char INT_jump_table[];

    Luca