Question: Write an LC - 3 program that will read in a 1 6 - bit value from the memory location DATA and a value between

Write an LC-3 program that will read in a 16-bit value from the memory location DATA and a value between 0 and 9 from the console. Let this value read from the console be denoted by x. Your program will rotate (also known as circular shift) the value read in from location DATA to the left by x bits. Finally store the final result at memory location given by RESULT. Recall that when performing bit rotation to the left, a bit that is rotated out of the msb becomes the lsb.
For example: if the 16-bit value to be rotated is 0110110010101111, then
Rotating left by 0 bits results in 0110110010101111(no change).
Rotating left by 1 bit results in 1101100101011110
Rotating left by 2 bits results in 1011001010111101
Rotating left by 3 bits results in 0110010101111011
and so on.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!