Question: Procedure: Shift and rotate operation for memory contents 1. In this part, you are asked to write a program in LC-3 machine language to shift/rotate
Procedure: Shift and rotate operation for memory contents 1. In this part, you are asked to write a program in LC-3 machine language to shift/rotate a bit pattern some number of bits to the left and store the result in memory. The number of bits the bit pattern should be shifted/rotate is called the shift/rotate amount. Shift amount is a non-negative number between 0 and 16, inclusive. 2. Your program should assume that: The initial bit pattern to be shifted if in memory location x3100. The shift/rotate amount n is in memory location x3101. Use those values to perform the left shift/rotate. In shift operation, fill the lowest n bits of the bit pattern with 0s. In rotate operation, the top n bits rotate into the lowest n bits. Store the result in memory location x3102. Hint: What happens when you add a number to itself? 3. When using the LC-3 simulator to test your program, you should manually load test values into these memory locations before running your program. 4. Your program must be a text file of binary characters. Each line contains a 16 character string of ones and zeros followed by a carriage return. The first line will give the starting address of the sequence of memory locations containing the program. Each line may have a comment
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
