Hi,
I'm using the Keil uVision compiler.
I would like to work with 64-bit values. I declare myVar as unsigned long long;
By some calculation myVar contains a value greater than 2^32 for example 0x0000 0131 2BCE D300.
If I divide it by 2 (or 0x2, or 2L) like 'myVar/=2;' then only the lowest 32-bits are divided. So: invalid result: 0x0000 0131 95E7 6980 should be : 0x0000 0098 95E7 6980
How can a solve this?
thanks,
Henk
Sounds like a bug you have to send to Keil support.
This could also be optimization, i.e. the compiler may have determined that the upper part of the quotient is never used. We should see a more complete code sample before reaching any conclusions.