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

Delay Loop in C51

Dear Friends,
How to create a delay loop in C51.Say for example I need a delay loop for 35mS.How to do this.I tried a code taken from this forum.It is
void delay(void)
{
unsigned long msdl;
msdl = 35L * 1000L;
while(--msdl)
{
_nop_();
}
}
Logically I think it should produce a 35mS delay code.But When I see in the Performance Analyzer window the delay produced is 0.547275 seconds.
Can anybody help me in solving this problem.
Thanx in Advance

Parents
  • the revision of your compiler

    That's what I mean by "change compilers". If it's a different .exe file, even from the same vendor, then the code generated may well not be the same.

    (Simiarly, if you're serious about configuration management, you don't just need version control on your source code; you've got to version control the entire toolchain as well, so that you really can go back to version 1 and rebuild it with the exact tools you used originally. Rebuilding the same source with a newer compiler may not produce the same binary you shipped out to the field two years ago.)

Reply
  • the revision of your compiler

    That's what I mean by "change compilers". If it's a different .exe file, even from the same vendor, then the code generated may well not be the same.

    (Simiarly, if you're serious about configuration management, you don't just need version control on your source code; you've got to version control the entire toolchain as well, so that you really can go back to version 1 and rebuild it with the exact tools you used originally. Rebuilding the same source with a newer compiler may not produce the same binary you shipped out to the field two years ago.)

Children
  • "if you're serious about configuration management, you don't just need version control on your source code; you've got to version control the entire toolchain as well"

    And, of course, "the entire toolchain" includes the OS to run it on!

    Just look at the number of threads here where people are struggling to get some ancient Keil version (written for MS-DOS v3.3) running on XP or something!! :-0
    eg, http://www.keil.com/forum/docs/thread4969.asp

    then you might also struggle to find a 286-based PC to run it on...

    I think some military projects have entire development systems (complete hardware & software) in store in case changes ever need to be made...