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
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.
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.
Erik
...by saying "nothing could be further from the truth"
But that, too, is a common rhetorical device...
"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"
where doues 'is' mean 'can not be' ?
Nowhere.
Your original statement:
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.
Modified as you suggest:
Yes, that seems correct now.
If you have to ask you have not read many of my posts
Ermmmm ... It was a rhetorical question.
I've read quite a few of your posts; and the responses they trigger!
Very entertaining ;)
What is the prize for people who get the right answer ?
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.
Here's hoping it's not a trick question!
Not at all. On the contrary, there's even a hint pointing in the right direction.
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.
An example of dry wit or the approach you follow?
... you can HOPE (a very useful approach to design)
If you know the compiler and the right syntax, it is possible to get a djnz when using a for loop.
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.
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.
Lots of complaints and arguments.
I read the comment
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.
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.
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
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.
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.
View all questions in Keil forum