I have been trying to shift my number with the formula m*2^-n by using Logical Shift Right (LSR). for m = 8 and n=-2 I should be getting 8(2)^-2 ie; 2, but I get 0 for some unknown reason.
CodePudding user response:
You need to first negate R1
before you can do ASR
. Shift values are unsigned, a negative shift value is interpreted as a very large positive shift, leading to a result of zero.