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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/08/11 15:04
Read: times


 
#182540 - and so what
Responding to: ???'s previous message
a compiler can do ANYthing, in ANY fashion as long as the result is correct.

it would be fully legal for a compiler to do the following:
C:
a= b + c;

resulting assembler:
mov a,#0
loop1: inc a
djnz b,loop1
loop2: inc a
djnz c,loop2

no compiler make of any sense would do so, but it illustartes the point that it is be fully legal for a compiler to ahieve the result n any fashion

Erik

yes, I know the code above does not take in consideration b or c being zero, but for illustration it will do.

List of 17 messages in thread
TopicAuthorDate
Compiler variations??            01/01/70 00:00      
   Fundamental philosophy of High-Level Languges (HLL)            01/01/70 00:00      
      C code            01/01/70 00:00      
         and so what            01/01/70 00:00      
         Stop wondering about the compiler output            01/01/70 00:00      
            Very nice to learn this important matter            01/01/70 00:00      
         Exactly what you wrote            01/01/70 00:00      
            volatile sbit may be the problem            01/01/70 00:00      
               read up on (not) volatile            01/01/70 00:00      
               Look at my profile            01/01/70 00:00      
                  Not offence intended            01/01/70 00:00      
                     defining P0_6 so that compiler doesn't treat it as volatile            01/01/70 00:00      
                        Skip the goto - almost always exists beautiful rewrites            01/01/70 00:00      
                           Goto really is a bastard code construct            01/01/70 00:00      
                              and therefore ...            01/01/70 00:00      
                                 Will come back with modified code            01/01/70 00:00      
                           Wonderful as always!            01/01/70 00:00      

Back to Subject List