#1926 Interrupts : Update to signal.h

closed-fixed
5
2013-05-25
2012-02-02
Mike W.
No

I'm using SDCC version 3.1.0 to develop interrupt code for the PIC18F4685 using macros in signal.h. I think
I've found a bug in signal.h.

In the main interrupt vector table the macro DEF_HANDLER(sig, handler) from signal.h generates code to branch to
the appropriate signal handler. Assembler BTFSC statements are used to test bits in SFR registers eg. INTCON. The BTFSC statements in signal.h do not explicitly specify whether the access bank or the BSR is to be used and are defaulting to the BSR. To access SFR the access bank should be used.

Discussion

  • Mike W.

    Mike W. - 2012-02-02

    Updates version of signal.h explicitly specifing the access bank when testing SFR bits.

     
  • Raphael Neider

    Raphael Neider - 2012-02-11
    • labels: --> pic16 target
    • milestone: --> fixed
    • status: open --> closed-fixed
     
  • Raphael Neider

    Raphael Neider - 2012-02-11

    I think you are right: btfsc f,b[,a] should default to a=1: use bank selected via BSR.
    However, using gputils, "btfsc f,b" gets assembled as with a=0: use access bank, ignore BSR. So gputils users should not have been affected by our incorrect omission of [,a].
    To be on the safe side, I updated signals.h in r7301.
    Thank you for the report.

    Raphael

     
  • Raphael Neider

    Raphael Neider - 2012-02-12
    • assigned_to: nobody --> tecodev
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks