I have to write a subroutine to calculate the value stored at R2 to left-shift by the value stored at R3 (R2 << R3). The result is saved at R3. So far I have this:
leftSHIFT ADD R0,R2,R2
ADD R3,R3,#-1
BRz MyEXIT
ADD R2,R0,#0
BRnzp leftSHIFT
MyEXIT ADD R3,R0,#0
RET
Now this code works correctly for other inputs like 004<003=032
. However, what I'm getting is 001<000=000
when I should be getting 001<000=001