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

Library function reentrancy?

I'm sure it's written somewhere and I'm not opposed to looking for it. However I have looked and found nothing so I'll ask.

There are a host of "behind the scenes" library functions that perform such magic as right or left shifts of various data types, etc. Even the ubiquitous switch() statement compiles into a special library call (LCALL ?C?CCASE) to do the work. My (probably paranoid) concern is the degree to which these functions may be employed in an interrupt routine.

I'm concluding that since none of my programs crash miserably that it's OK to use any "c" construct in an interrupt routine and that the behind the scenes library functions are designed for reentrancy.

It would just be nice to find that in print somewhere. Thanks for reading & commenting.
Steve C.

Parents
  • Thanks Andy,

    You understand the question.

    Jon,
    The run-time routines in the library use only registers and are therefore reentrant.

    Are you refering to the hidden functions that I'm talking about? If so, what is the basis for your comment? I too can conclude that the functions must be reentrant or we'd all be in a world of hurt. But where does it say that?

    According to the link that Dan posted (http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm) - and what I also found in the C51 manual:
    Many of the routines in the C51 standard library are reentrant and/or intrinsic.

    Many, but not ALL. And it says nothing of the of the other hidden functions.

    Thanks for all of your replies.
    Steve C.

Reply
  • Thanks Andy,

    You understand the question.

    Jon,
    The run-time routines in the library use only registers and are therefore reentrant.

    Are you refering to the hidden functions that I'm talking about? If so, what is the basis for your comment? I too can conclude that the functions must be reentrant or we'd all be in a world of hurt. But where does it say that?

    According to the link that Dan posted (http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm) - and what I also found in the C51 manual:
    Many of the routines in the C51 standard library are reentrant and/or intrinsic.

    Many, but not ALL. And it says nothing of the of the other hidden functions.

    Thanks for all of your replies.
    Steve C.

Children