PIC14: BANKSEL Problem

  • Hi,

    I have tried to use the SDCC compiler for the PIC14 port. But it seems that this is not possible because the generated code is very big.

    SDCC inserts before any access to a register a BANKSEL.

    In the most of this cases a BANKSEL would not be neccessary because both registers are located within the same bank!

    And if the bank is truly different it would be better to check whether the bank could be changed by setting or clearing only one of the two bits for the bank selecting.

    I have used the most recent version of SDCC to test this behavior.

    I think that the current version of SDCC does not allow to modify the BANKSEL behavior because I could not find any options to modify this and so on.

    The PIC16 port of SDCC seems to have a option to optimize the behavior. Would it be possible to implement such option for the PIC14 port?



  • Zenon Bolino
    Zenon Bolino


    Not sure if it is related, but I recall having problems with BANKSEL and solved with the instruction -mplab-comp when compiled the code.