??? 06/26/05 13:43 Read: times |
#95957 - defination under Keil |
Hi all,
I am used IAR and occasional user of Keil. I have a problem with Keil which may be trivial to you guys. I have the following code which works in IAR and produces the correct code. But Keil warns a DIV BY ZERO message. I found, this is due to the tic12, which evalutes to 0.5425, hence the compiler treats it as zero. However, my interest is in the integer part of the final evaluation. In Keil, how will I realise this? #define Xtal 22.1184 #define tic12 (12/Xtal) #define _10msec (65536 - ((1000 * 10) / tic12)) . . TL1 = _10msec; TH1 = _10msec >> 8 ; . . regards, |