if Average_Zero_Cross_Time is a two byte quantity, its product by tmp_u8 (which I suppose is an eight bit quantity) is a three byte quantity. The most significant byte of this product is: HIGH_BYTE( HIGH_BYTE(_Average_Zero_Cross_Time) * _tmp_u8) The middle byte is: LOW_BYTE( HIGH_BYTE(_Average_Zero_Cross_Time) * _tmp_u8) + HIGH_BYTE( LOW_BYTE(_Average_Zero_Cross_Time) * _tmp_u8) Finally the least significant byte of this product is: LOW_BYTE( LOW_BYTE(_Average_Zero_Cross_Time) * _tmp_u8) So, only your first code is correct. _tmp_u16 isn't however needed, since it can be replaced with _Demag_Time. Happy new year! EtaPhi
First of all I would like to thank you for your reply, But Average_Zero_Cross_Time is only an 8-bit quantity and the result of multiplication would be in the 16-bit index register X. Regards..