We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
In one of my project I am talking with MX909 Driver IC with C51 ucontroller. To initialize MX909 if I write module in Assembly language it's working fine. Once I replaced with C same module it's not working.
The only difference I can make for both assembly and C languages is NOP and _nop_() instruction. Is both instructions will take same number of machine cycles?
Thanks, Suresh Kumar Kavula
If you know the compiler and the right syntax, it is possible to get a djnz when using a for loop.
And THAT is the point!
Knowledge of what is possible and the means to achieve it along with the ability to explain things without sounding like an obnoxious teacher is the sign of a true authoritative poster.
In general, you can't assume that.
True. But it's a long walk over very thin ice from that to Erik's "nothing could be further from the truth". It's this kind of excessive generalization and his reaction when they're pointed out to him, that so irritates people about Erik.
Assume nothing about the compiler, except that it is actually working correctly. The for loop above will result in (more than one answer may be correct):
a) a DJNZ loop b) another type of loop c) no loop at all
What is the prize for people who get the right answer ?
Here's hoping it's not a trick question!
Is this supposed to be funny ?
Not funny - More sad ... That a potentially useful forum can have so many members that post useful responses muddied by very few who post in a manner that just triggers such negative reactions.
Lots of complaints and arguments.
I read the comment
My guess is that you suffer from some fallacy that e.g. a for loop is the same as a djnz loop and nothing could be farther from the truth.
as
Don't think that a for loop is equivalent with a djnz loop.
Any people who read it as:
The compiler will never make use of a djnz in a for loop.
should maybe be a bit more careful about complaining, since Erik did not claim any such foolish thing.
and then you can HOPE (a very useful approach to design) that it will still be a djnz loop in the next release of the compiler.
Erik
re my post that caused so much reaction: assuming a for loop is the same as a djnz loop and nothing could be farther from the truth.
where doues 'is' mean 'can not be' ?
... you can HOPE (a very useful approach to design)
An example of dry wit or the approach you follow?
If you have to ask you have not read many of my posts
maybe be a bit more careful about complaining, since Erik did not claim any such foolish thing.
Maybe, if he'd been a little more correct with his punctuation, people might have been able to understand it more easily.
Hope he doesn't write his code in the same manner.
The warm, fuzzy feeling of knowing that they won't fall into the trap of expecting a delay loop in C to give an exact delay.
Not at all. On the contrary, there's even a hint pointing in the right direction.
Ermmmm ... It was a rhetorical question.
I've read quite a few of your posts; and the responses they trigger!
Very entertaining ;)
Nowhere.
Your original statement:
Modified as you suggest:
My guess is that you suffer from some fallacy that e.g. a for loop can not be the same as a djnz loop and nothing could be farther from the truth.
Yes, that seems correct now.
"a for loop is the same as a djnz loop"
That is, indeed, a fallacy and very far from the truth!
It's equivalent to saying something like, "a quadruped is the same as a cat"
...by saying "nothing could be further from the truth"
But that, too, is a common rhetorical device...
wlee Mr. smoked sardine, as usual you put words in my mouth that I would never use.
if you want6 a different then here it is My guess is that you suffer from some fallacy that e.g. a for loop always is the same as a djnz loop and nothing could be farther from the truth.