Hi,

>     extern SIGHANDLER(rtcHandler) ;
>
>     DEF_INTHIGH (high_int)
>     DEF_HANDLER (SIG_TMR1, rtcHandler)
>     END_DEF
>
> and in a separate file:
>
>     SIGHANDLER (rtcHandler)
>     {
>     ...etc
>     }
>
> it compiles fine, but the assembler doesn't like it:
>
> interrupts.asm:883:Error [113] Symbol not previously defined  
> (_rtcHandler).

>
> If I put everything in the same file it works fine.
>
> Is this a limitation of the compiler/assembler, or it just failing to
> output the neccessary extern references for an __interrupt function  
> (which
> SIGHANDLER expands to), or am I missing something terribly obvious!

The problem here is that the PIC16 backend does not see any use
of "extern void rtcHandler(void)" and thus incorrectly opts not to
emit the 'extern _rtcHandler' directive into the .asm file.

You can work around this issue by replacing

   extern SIGHANDLER(rtcHandler);

with

   extern unsigned rtcHandler;

For variables, the PIC16 backend seems to correctly emit the
'extern' directive, and as the routine is only used in the
assembler/macro, the type is no real issue. This is not clean,
but works for me.


Raphael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to