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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/03/03 07:55
Read: times


 
#53956 - OT: Compiler observation
Responding to: ???'s previous message
mahmood Elnasser wrote:
-------------------------------
TH2 = RCAP2H = rate >> 8;
TL2 = RCAP2L = rate;


Regarding line #2 of Mahmood's example and generalizing it a bit, I have seen one compiler implement the statement:

    HW_REG1 = HW_REG2 = value;

as:
    HW_REG2 = value;
    HW_REG1 = HW_REG2;

and another compiler implement the same statement as:
    HW_REG2 = value;
    HW_REG1 = value;

A problem arises in the first case if HW_REG2 is a write-only register. Just something to be aware of... Not that any of you would write code like that, of course ;-)

When dealing with hardware registers, explicitness is your friend.


List of 24 messages in thread
TopicAuthorDate
unpredictable first character            01/01/70 00:00      
   RE: unpredictable first character            01/01/70 00:00      
      RE: unpredictable first character            01/01/70 00:00      
   RE: unpredictable first character            01/01/70 00:00      
      OT: Compiler observation            01/01/70 00:00      
         RE: OT: Compiler observation            01/01/70 00:00      
         RE: OT: Compiler observation            01/01/70 00:00      
            RE: OT: Compiler observation            01/01/70 00:00      
      RE: unpredictable first character            01/01/70 00:00      
         RE: unpredictable first character            01/01/70 00:00      
            RE: unpredictable first character            01/01/70 00:00      
   RE: unpredictable first character            01/01/70 00:00      
      RE: unpredictable first character            01/01/70 00:00      
   RE: unpredictable first character            01/01/70 00:00      
      RE: unpredictable first character            01/01/70 00:00      
   RE: unpredictable first character            01/01/70 00:00      
      RE: unpredictable first character            01/01/70 00:00      
         RE: unpredictable first character            01/01/70 00:00      
         RE: unpredictable first character            01/01/70 00:00      
      RE: unpredictable first character            01/01/70 00:00      
      RE: unpredictable first character            01/01/70 00:00      
   it works - conclusion please            01/01/70 00:00      
      RE: it works - conclusion please            01/01/70 00:00      
         RE: it works - conclusion please            01/01/70 00:00      

Back to Subject List