Given 2 numbers, x and n, what’s the method to multiply x by 2^n ?
For instance x=3.7 and n=5. so 3.7*2^5 = 118.4.
I need this done without using the FPU commands (math coprocessor).
So i figured that numbers in 32 bt processor are represented by 32 bits: the 1st is for the sign, next 8 (2-9) are for the exponent, and the following 23 are called the SIGNIFICAND.
The exponent field is the k in 2^k. So what i need to do is only change the exponent field and add n to it. exponent = exponent + n .
So how do i do this in assembly 8086 ?
Thank you
Here’s some quite ugly inline asm, VS style. Hopefully you’ll get the idea:
This obviously does no checking for overflow, etc.