2 Replies Latest reply on Sep 28, 2017 1:25 AM by SampathS_11

    "LCALL" of PSoC Designer Complier

      We built a self-made program and watching the list file, we see the process jumping to the ROM area other than the self-made program by LCALL. Because LCALL is seen in normal operation processing such as right shift calculation processing (a >> b), I think that there is an area where operation processing is organized behind the area to which my own function has been assigned

      Q1. Is this recognition correct?


      Also, when we changed any constants of the program and building it, the placement of the instructions on the hex file was swapped in the area other than the self-made program (the area where the operation processing described above is summarized).

      Q2. We think that the placement of each computation process is exchanged, but the the contents of processing is not changed, is it correct?


      As the specifications of the compiler and assembler,

      Q3. What kind of instructions are described outside the area of the self-made program (reference destination of LCALL) ?

      Q4. What is the behavior of the compiler and assembler when changing any constants are made that do not affect the ROM capacity?


      Best Regards,

        • 1. Re: "LCALL" of PSoC Designer Complier

          Hopefully understanding you correctly:

          LCALL is used when the target is not within +- 128 bytes from the current instruction else a simple CALL is used. So this is something quite usual.

          The PSoC needs to be initialized, the code for this is found in the file "Boot.asm".

          After initialization main() is called (probably using LCALL). this ensures when main() is exited that the complete initialization is repeated.

          All interrupt handlers are callef using LCALL or LJMP.

          There are some optimizations done by the compiler, so changes in program flow can be considered normal when anything in source are changed.


          What is your "self-made program" written in? C-language or Assembly??


          What is your concern? Anything not working as expected?? You can create and upload a project archive, so we all can check your project for correctness.



          • 2. Re: "LCALL" of PSoC Designer Complier

            A1/A3. Your recognition is correct. A PSoC Designer project has code other than the code you have written. This includes math libraries, string libraries, startup code, and the code for the user modules.and device configuration. So you can frequently see LCALLs to code other than yours. Just for information kindly refer to the PSoC Designer Libraries Guide.


            A2/A4. When constants are changed, there is a chance that the code might also change. This depend on the nature of the function itself, and the compiler optimization options. So you can expect to see changes, but not for every value of the constant.