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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/19/08 01:58
Read: times


 
#151086 - What is the execution order ?
Responding to: ???'s previous message
P0 = string1[z] & 0x3F | 0x80;

Whast do You think, how will this be interpreted if the OR is done first and right after that the AND. I am too old to remember the order of execution of those and, or, xor and so on - so I use prantheses - always when unclear.

It is my assumption that in this case the OR is actually performed first and then the AND cancels the effect of it. This turns the bit 7 down which in turn resets Your display.

The () parentheses do not cost CPU-wise anything but they are a sort of guarantee of execution order - which is really important in this case.

P0 = (string1[z] & 0x3F) | 0x80; // Ahhhh.... lot better

List of 11 messages in thread
TopicAuthorDate
argggg....I'm stuck again.....:(            01/01/70 00:00      
   The clear bit is wron way around.            01/01/70 00:00      
      Esko..Just verified clear bit            01/01/70 00:00      
   What is the execution order ?            01/01/70 00:00      
      Verified the order execution            01/01/70 00:00      
         So it is the sbit thing that is hurting You now.            01/01/70 00:00      
            Correction: Place the CALL before data loop            01/01/70 00:00      
   A few suggestions for Your code            01/01/70 00:00      
      I will adapt some of it, thank you            01/01/70 00:00      
         I (don\'t) C            01/01/70 00:00      
         Make life easier            01/01/70 00:00      

Back to Subject List