1

Essentially, I need to have the user input some value x, perform this operation:

2^x

and then print out whatever value that is. I'm not sure what's the best way to tackle this. Should I just do loop multiplication (like multiply 2 * 2 x times) or is there another way?

Anon
  • 31
  • 4

1 Answers1

0

Since Binary to decimal goes by powers of 2's... assuming you don't exceed the maximum space in the register... you can use the Shift Left Logical Command to push a bit from the 1's to the 2's slot... etc.

A P
  • 2,131
  • 2
  • 24
  • 36