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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/27/09 10:41
Read: times


 
#171224 - Unsigned Long Roll-over at 65535?
Hi, its my first time to consider unsigned long on my 8051. after some code i notice that unsigned long roll-over at 65535, and also with addition. already tried using internal and external data, also with small to large program. all this with keil compiler.

i was thinking that my 51 just have 1 dptr, but reading keil help-menu there shouldn't be any problem on using it, with code

MYLONGBYTE=(byte4<<24)|(byte3<<18)|(byte2<<8)|byte1;

then when i try to recover MYLONGBYTE, byte4 and byte3 would be zero.
byte4=MYLONGBYTE>>24;
byte3=MYLONGBYTE>>18;


thank you .

List of 9 messages in thread
TopicAuthorDate
Unsigned Long Roll-over at 65535?            01/01/70 00:00      
   Typecast before the shift.            01/01/70 00:00      
      oh..my mistake.....            01/01/70 00:00      
         Integer promotion            01/01/70 00:00      
            Note on Integer Promotion and Keil            01/01/70 00:00      
               Not much of a choice, really            01/01/70 00:00      
                  Probably            01/01/70 00:00      
                     Design decisions            01/01/70 00:00      
                        Oh yes they can!            01/01/70 00:00      

Back to Subject List