Question: Note: For both programs, you are asked to use LDI and STI to load from and store to the designated data address. ( 2 points

Note: For both programs, you are asked to use LDI and STI to load from and store to the designated data address.
(2 points) Write an LC-3 program (starts at x 3000) in hexadecimal that rotates the bit pattern stored at x4000 to the right by the amount specified by a number stored at x4001. The rotated pattern is then stored at x 4002.
For example, if we set Mem[x4000]=0001001101110000 and Mem[x4001]=9, then after the program executes, Mem[x4002]=1011100000001001.
(2 points) Write an LC-3 program (starts at x 3000) in hexadecimal that reverses the bit pattern stored at x 4000. The reversed pattern is then stored at x 4001.
For example, if we set Mem[x4000]= x9871=1001100001110001, then after the program executes, Mem[x4001]=1000111000011001=x8E19
Note: For both programs, you are asked to use LDI

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 Programming Questions!