Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/10/08 11:43
Read: times


 
#152076 - Fundamental flaw
Responding to: ???'s previous message
David Prentice said:
If you write in 8051 assembler you can count cycles directly.

Of course.

If you write in C you can view the generated assembly.

True, but not useful.
As Christoph said, you have absolutely no guarantee wyhatsoever that the next compile run will generate identical code!
See: http://www.8052.com/forum/read.phtml?id=152069
See also: http://www.8052.com/forum/read.phtml?id=152071

Therefore, you would have to re-examine the generated assembler after every single compile run!
Clearly, this is not practical! You might as well just do it in assembler in the first place - then you know that nothing will change unless you change it!

Now when you have some fairly trivial code, I expect you can hand optimize this generated code. Or perhaps you look at it and think:
If I was a compiler I could never do better.

This is not really a question of optimisation - it's a question of being sure about the timing!

I would prefer the hardware solution to this anyway, since you could keep in a HLL.

True.




List of 32 messages in thread
TopicAuthorDate
One RS232 port and two devices            01/01/70 00:00      
   Almost certainly not!            01/01/70 00:00      
      neither one talks back            01/01/70 00:00      
         Soft-UART ?            01/01/70 00:00      
         Simplex            01/01/70 00:00      
            responses            01/01/70 00:00      
               The beaty of the 8051            01/01/70 00:00      
                  why all this about bit-banging            01/01/70 00:00      
               Bit banging UART TX.            01/01/70 00:00      
                  Easy to get wrong.            01/01/70 00:00      
                     Point taken, but you can calculate delay.            01/01/70 00:00      
                        Depends on compiler/etc...            01/01/70 00:00      
                           Don't use HLL!            01/01/70 00:00      
                              Cycle counting.            01/01/70 00:00      
                                 Fundamental flaw            01/01/70 00:00      
                              Not an Absolute....            01/01/70 00:00      
                                 RE: Never is a strong word            01/01/70 00:00      
                                    ... and            01/01/70 00:00      
                              assembly verses HLL            01/01/70 00:00      
                           Use a Timer IRQ to set the soft baudrate            01/01/70 00:00      
                              Surprise.            01/01/70 00:00      
                                 High risk            01/01/70 00:00      
                                    Straying into fantasy.            01/01/70 00:00      
                                       Not so fantastic?            01/01/70 00:00      
                  Resistance is too high            01/01/70 00:00      
                  Another reason why this is not so easy...            01/01/70 00:00      
               Timescales            01/01/70 00:00      
      message formatting            01/01/70 00:00      
         Try it now            01/01/70 00:00      
            It's OK now, thanks.            01/01/70 00:00      
   Two RS232 devices            01/01/70 00:00      
      the LCD display            01/01/70 00:00      

Back to Subject List