Question: For your programs in problems 1 : write the binary LC - 3 instruction and the corresponding RTL or assembly in the following format: Note

For your programs in problems 1: write the binary LC-3 instruction and the corresponding RTL or assembly
in the following format:
Note how bits are arranged in groups that correspond to instruction-specific operands.
If you are not sure about the RTL format of a certain instruction, you can refer to Appendix A of your Patt &
Patel text or read sections 5.5 and 6.1. Try to make your program as simple and intuitive as you can.
LC-3 Programming in machine language
Short programs in LC-3 binary code
For each of the following tasks, systematically decompose the problem to the level of LC-3 instructions, then write LC-3 instructions to implement your
solution. Turn in your flow chart and LC-3 instructions in binary. For credit, each instruction must be annotated with a comment in RTL or assembly.
Assuming that R20, write a program that determines if the value stored in R2 is even. If R2 is even, store in R1 the value 1, otherwise store the value
-1. To receive credit, you can only modify the contents of R1, and no other register, and your solution should have no more than 7 lines of code.
Assuming that R4 contains a positive value less than 15, put the value 2R4 into R3. To receive credit, you can only modify the contents of R3 and R4,
and no other register and your solution should have no more than 9 lines of code.
Write a program that adds each of the negative numbers stored in memory locations M1 through M2, inclusive, and stores the result in register R3.
Assume that address M1 can be found in register R1 and address M2 can be found in register R2. To receive credit, you can only modify the contents of
R1, R2, R3, R4, and no other registers, and your solution should have no more than 12 lines of code. Note: You do not need to consider the case when
M1 is greater than M2.
For your programs in problems 1 : write the

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