DEAR TO ALL, I AM DEALING WITH C8051F120 MICROCONTROLLER.UTILIZING 16 X 16 MAC ENGINE OPERATION.I AM DOING ASSEMBLY LANGUAGE PROGRAMMING USING THIS MICROCONTROLLER FOR MULTIPLICATION. IS IT POSSIBLE TO MULTIPLY TWO UNSIGNED 16 BIT INPUTS? IF YES, THEN HOW ?
so i am asking you all that is there any bit (other than msb bit) that we can set or clear for signed or unsigned operation
say your input value is in "int Ralph"
and you right now do xxxxx Ralph; (I do not check for actual MAC code)
Just change to xxxxx Ralph/2; (the compiler wikk change that to a shift 1 - or - you can, of course use ralph >>=- 1;
are you multiplying or multiply-adding? If you are just multiplying then do this at the end result <<= 2; and you will be fine.
BTW why the worry about signed/unsigned, if the values you multiply are >32k (where signed/unsigned differ) the result will not fit in an int.
Erik