Week 8, Lab 3: Thursday, October 22, 2009

In this lab assignment you will get started on the LC3 simulator to write a very simple LC3 program. You must write the code in binary or LC3 assembly: this is what you will hand in (or demo to the TA in the lab).

Write the LC-3 code to determine the absolute value of the input value. The input value is loaded from memory location x3100 into register R0. The absolute value will be loaded (and returned) in register R5. Hint: you may find 2's complement number representation useful. Note that absolute value of 12 is 12, absolute value of -27 is 27.