??? 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 . |
Topic | Author | Date |
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 |