Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a machine code program for all the following problems. Test to make sure that they work in LC3. Its best to complete each step

  1. Write a machine code program for all the following problems. Test to make sure that they work in LC3. Its best to complete each step and test before moving onto the next. No credit if you write code in assembly. Your machine code file name must be named, Multiply.bin
    1. The LC-3 has no multiply instruction. You must write code to allow for multiplication of two numbers. These numbers must be loaded into the registers R3 and R4 from memory. Load R3 with contents of memory from x4000 and R4 from x4001. In other words, someone running this code will place the data in these two memory locations.
    2. Write machine code to multiply the contents of R3 with the contents of R4. The result must be stored in R5. In other words, R5 = R3 * R4.
    3. You must also store the result at memory location x4002.
    4. Modify your code to change the contents of register R2 based on the final result stored in R5. If R5 is greater than 0, R2 must be set to 1 If R5 is less than 0, R2 must be set to -1 If R5 is equal to 0, R2 must be set to 0
  • Start your program at x3000 so that it will be easier for me to grade it.
  • Each program must include a header comment that has your name(s) and a brief description of the program.
  • Make sure to comment logic of your program. You will be graded on comments.
  • Did you test your program for different values? Positive, Negative, Zero?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions