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

"register"

hello,

If i enter the word 'register' it appears in blue, so that means it is a 'reserved keyword'.I wonder what the purpose is of this keyword 'register' and for what i can use it... Can anybody help me?

(I'm a newbie in Keil C51 compiler.)

thanks and greetz

Parents
  • Now, what is it that Erik keeps saying about testing...? ;-)
    Testing, Yes absolutely. Trying is OK.

    Trying the above would never have any effect on whether the end product would work or not.
    If the reason for using "register" is a time critical function, C should not have been used anyhow.

    Erik

Reply
  • Now, what is it that Erik keeps saying about testing...? ;-)
    Testing, Yes absolutely. Trying is OK.

    Trying the above would never have any effect on whether the end product would work or not.
    If the reason for using "register" is a time critical function, C should not have been used anyhow.

    Erik

Children
  • "If the reason for using "register" is a time critical function, C should not have been used anyhow."

    What other possible reason could there be? Quoting from the previously quoted section of the standard:

    "A declaration of an identifier for an object with storage-class specifier register suggests that acces to the object be as fast as possible."

    Stefan

  • "If the reason for using "register" is a time critical function, C should not have been used anyhow."

    What other possible reason could there be?


    Here we are in PC land again. for a PC application you might want something as fast as possible without the programmer making any effort - typical PC programmer attitude.
    For a microprocessor application the above doesn't cut it, in that case it is as fast as possible with the programmer making an effort - which should be the attitude of every microcontroller programmer - and that is impossible in C.

    Please note: I recommend that all non time critical code be written in C, I am not an assembler fanatic; however when I see microcontroller programmers try to avoid the dreadful assembler I cringe.

    Erik

  • hi,

    seems to be a popular topic that 'register' thing,however, thanks for the info

    greetzzz,
    peter