This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Access a function using address

Since the c51 compiler does not support the recursive call of a function is there any way to find out on which address location the function which is to be called as a recursive is located?

That is, is there any way to implement the recursive call funtion in a similar way of a software reset i.e just call like this ,

((void (code *) (void)) 0x0000) ();

Parents
  • ***Warning L13: RECURSIVE CALL TO SEGMENT
       SEGMENT : ?PR?_?DEVICE_ID?MAIN
       CALLER  : ?PR?TOTAL_DEVID?MAIN
    

    This is the warning message. Actually the reentrant function is Device_ID().My function look like this,

    void Device_ID(void) reentrant
     {
       .
       .
       func1();
       .
       .
       func2();
       .
       .
     }
    
    void func1(void)  //this is not reentrant
     {
       .
       .
     }
    
    void func2(void)  //this is not reentrant
      {
        .
        .
        func3();
        .
        .
      }
    
    void func3(void)
     {
       .
       .
       Device_Id();   //in this function only i call the
                      //reentrant function
       .
       .
     }
    

    I already told that the setting i did in the startup.a51.

    Now what should i do?

Reply
  • ***Warning L13: RECURSIVE CALL TO SEGMENT
       SEGMENT : ?PR?_?DEVICE_ID?MAIN
       CALLER  : ?PR?TOTAL_DEVID?MAIN
    

    This is the warning message. Actually the reentrant function is Device_ID().My function look like this,

    void Device_ID(void) reentrant
     {
       .
       .
       func1();
       .
       .
       func2();
       .
       .
     }
    
    void func1(void)  //this is not reentrant
     {
       .
       .
     }
    
    void func2(void)  //this is not reentrant
      {
        .
        .
        func3();
        .
        .
      }
    
    void func3(void)
     {
       .
       .
       Device_Id();   //in this function only i call the
                      //reentrant function
       .
       .
     }
    

    I already told that the setting i did in the startup.a51.

    Now what should i do?

Children