Skip to main content
henrik2
Associate II
Jul 6, 2007 5:38 AM UTC
Question

Skip-jump table with Cosmic

Posted on July 06, 2007 at 07:38

Skip-jump table with Cosmic

This topic has been closed for replies.

7 replies

henrik2
henrik2Author
Associate II
Jul 3, 2007 12:25 PM UTC
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

luca239955_st
Associate II
Jul 4, 2007 4:38 AM UTC
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)

henrik2
henrik2Author
Associate II
Jul 4, 2007 4:44 AM UTC
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

luca239955_st
Associate II
Jul 4, 2007 12:57 PM UTC
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

henrik2
henrik2Author
Associate II
Jul 5, 2007 4:55 AM UTC
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

luca239955_st
Associate II
Jul 5, 2007 11:10 AM UTC
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

luca239955_st
Associate II
Jul 6, 2007 5:38 AM UTC
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