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

Reentrant?

I rarely ask questions on this forum, but since I couldn't [easily] find it in the help-files, or on-line, I'm asking you guys.

I usually (like never) don't use the 'reentrant' pragma, but I think I may have to do that with a particular routine.

BUT I can't find the key-word that declares a function as reentrant. Am I missing something? Is there one for Keil's IDE tools? If so, what is its form? Can I get a link to the 'official' use of it?

Thanks in advance, and I need it asap because I need to pass this class and I don't want to really learn how to do this 'embedded' stuff anyway but the teacher keeps hounding me.

--Cpt. Vince Foster
2nd Cannon Place
Fort Marcy Park, VA

  • //Hopes useful for you

    void Count(char param) reentrant
    { //
    }

    void main(void)
    { while(1) { Count(1); }
    }

    //EzSVCS, SVCS for keil, http://easysoft.cc

  • Thanks for your input, but your prior post seemed a bit 'spam-ish' and I don't simply link to any site without knowing more about it.

    Ref my post:
    http://www.keil.com/forum/docs/thread12146.asp

    and your site's info is:

    www.alexa.com/.../http://easysoft.cc

    I do appreciate your input, but I'm kind of waiting for the veteran forum contributors to help [fully] answer my question.

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

  • BUT I can't find the key-word that declares a function as reentrant. Am I missing something?

    Yes - first year computer science.

  • Are you still left with the impression that the world works the same as they told you at school?

    Given that Keil already has the "reentrant" keyword for some if its compilers, it is most definitely prudent to check if there is any extra magic needed for other embedded compilers:

    http://www.keil.com/support/man/docs/c51/c51_le_reentrantfuncs.htm

  • As far as I can recall, Jack, first year computer science does not even start touching these issues (at least, not in the institution where I studied. The more theoretical programs don't, at all!). I guess this puts me high on your black list, then.

  • Yes - first year computer science.

    C'mon, Jack, if you want to be condescending, at least do it right. First year computer science does not necessarily involve C in any way, and therefore won't convey the bit of information that C functions are considered reentrant by default unless noted otherwise in the compilers manual.

    Therefore, you'd have to point to K&R or another C textbook, not first year computer science classes.

  • Therefore, you'd have to point to K&R or another C textbook, not first year computer science classes.

    But Christoph, the captain told us in the past that he had the privilege of working together with some of the guys that thought up C in the first place. Do you seriously believe Jack can muster K&R against him...?

  • .....working together with some of the guys....

    And I worked together with some of the guys from Led Zeppelin, but it hasn't made me a great musician!

  • ...but it hasn't made me a great musician!

    that was not my intention. But Jack's insinuation that the captain needs basic training after all these years is in simple terms - repugnant. The guy was/is building guided missiles, for god's sake (maybe that's Jack's problem...?).

  • "... The guy was/is building guided missiles ..."

    I trust you're not using the same associative logic which says that because someone is considered to be an intellectual, he is fit to run a country.

    Consider Gordon Brown - OMG ;-(

  • Whoops. I've wandered right off topic into politics.

    Many appologies.

  • don't worry about it. do you think this is a coincidence :-) :-)

    Gordon Brown
    George Bush

  • Well, I must say its nice to see people defend me from the Fish Brain. For the record, I worked with people who helped develop the ANSI Standards for "C" not C itself.

    Since I was in elementary school learning electronics et al, by the time I was in high-school, I designed my first battery operated EMBEDDED computer using the only low-power "CMOS" processor out there: the CDP1802.

    I hand-wrote the Intellec 8 HEX format files using an old CP/M computer (IMSAI 8080) and some of those friends of mine (who went to those meetings that Wozniak & Co went to "back in the day"---the "Homebrew Computer Club") would burn a PROM for me.

    So I'm kinda sorry I am missing "first year computer science." But somehow, I seemed to know as much as Per knows and that it is "prudent" to check.

    And back then we didn't exactly call it "computer science" anyway. It was either a degree in Electrical Engineering (EE) or Software Engineering (SE). Not "CS" whatever.

    I've watched Keil grow from non-existence to a big company. I've seen the 'other' cross compiler companies spring up and either fold or continue.

    Obviously, I stuck with Keil. I remember when the 8048 and 8051 came out. When the 80C51 came out, I converted my 'old' 1802 design over to it. I learned "C" using BDS Leor Zolman's new "C" compiler for the IMSAI system and then my Z80 based 'sweet' TeleVideo system.

    Most of the military work uses Ti DSPs (Code Composer) and Actel FPGAs... and surprisingly, the 80C51FB was used in a few of them: Archemedes (Yes, I know the Keil connection there), then Keil.

    I know what processor fits what application. In the missile world, the constraints on a system are very demanding: especially real-estate, not to mention 30,000 g loads.

    I loved the Led Zeppelin analogy (Best band on the planet EVER), but if that analogy was to apply, then I was some kid--learning music--who was hanging out with them as they wrote and practiced their stuff. Doesn't make me Led Zeppelin, but I learned from the best.

    Don't go down the Political Path, because like being an R&D Aero/Mil Senior Level EE/SE working on 'cutting edge' weapon systems (now I'm doing some Life-Science Bio work), I'm just as good at politics.... this is NOT the forum for that.

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

    P.S. OMG, I'm surprised I even deal with sardine level people. And FYI the phrase "Blowing Crow" has to do with a crow's ability to count to three, and not four, so when you 'blow crow', you've exceeded your 'stack' capacity to handle anything complex.

  • I dare to say, captain, that some of us (me included, naturally...at least for a while) are totally out of their league...!
    I am confident that everybody here (except one person, maybe...) appreciates your contribution of this forum.