i want to multiply 24bit value which i get from spi ,i stored it in an array of 3byte & i want to multiply with a constant of 8bit,the result i get which is a 32bit has to be divided with a constant of 32bit i want a c code for this procedure so pls help me
thanks a lot dan henry for your code but i don't know exact algorithm for division of 32bit/32bit no,can i put k=e/s for that or should i do it in another way if yes tell me the procedure
"can i put k=e/s for that ..."
Yes. The result of the '/' operator is the quotient from the division of the first operand by the second; the result of the '%' operator is the remainder.
mr.dan henry i am interested in knowing what the following code do
do {
w = e - s;
if (w < 0)
goto endit;
s >>= 1; : : } while ((s & 0x80000000) == 0); : : endit: i didn't understand the procedure clearly how to divide 32bit/32bit pls send me algorithm
"i am interested in knowing what the following code do"
It was only intended to illustrate my interpretation of what part of your assembly code was doing and how one might go about translating assembly to C. The ':' characters indicate that more follows but is left as an exercise for the reader (you) to complete.
"how to divide 32bit/32bit "
unsigned long dividend, divisor, quotient, remainder; quotient = dividend / divisor; remainder = dividend % divisor;
This is basic C stuff. You should try to get your hands on a C tutorial and/or reference book.