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.
Think you. I modified my source :
printf("%lu * %bu = ", N, M); printf("%lu\n", Freq); Freq=25690112L; printf("%lu * %bu = ", Freq, 4); Freq*=4; printf("%lu\n", Freq);
It work correctly. but the Long Integer Multiple fault also.
Run Result: 24500000 * 4 = 4294926936 25690112 * 4 = 1568
One problem with the concept:
Thinking can result in the correct answer.
On the other hand, testing can result in a false positive/negative, because without thinking, not all parameters may have been correctly tested.
It is often better to know why something works/doesn't work, then to deduce the function by trial and error.
I would typically agree with you; however, in this particular case. the questions is "does the simulator simulate correctly".
'Thinking' will not help here, however a 5 minute effort trying the same on the emulator will give the absolute answer. If the answer is the same, the code (or the compiler) is faulty, if the answer is different, the simulator is faulty there is no possibility of a "false positive/negative"
"better to know why something works/doesn't work". I doubt anyone but a Keil employee would have any benefit from finding out why the simulaotor does not work, should that be the case.
No, there is absolutely nothing wrong with 'thinking' when applied where efficient but spending days 'thinking' about something when an experiment can give the total and absolute answer is definitely not applying 'thinking where efficient'. This is especially ludicrous when the answer, beyond yes or no has no value to the 'investigator'.
The OP stated in an earlier post that the simulator worked when "hardware acceleration" or some such thing was not specified which directly would be revealed as either code, compiler or simulator error by the simple test I suggested.
Now, if the OP insist on 'thinking' there even is a simple means of analyzing by that method: check the generated assembler. That, of course, again, is much more cumbersome that a 5 minute test.
Erik
PS just to repeat; I strongly advise against determining things by 'experimenting' unless, as in this case, the answer is absolute and paametre variance independent. Especially when tool performance is in question an experiment (or looking at the generated assembler) is often the only way to determine the facts.