2.1 Problem Statement
The numbers X and Y are found at locations x3120 and x3121, respectively. Write a program in LC-3 assembly language that does the following:
Compute the difference X - Y and place it at location x3122.
Place the absolute values |X| and |Y| at locations x3123 and x3124, respectively.
Determine which of |X| and |Y| is larger. Place 1 at location x3125 if |X| is, a 2 if |Y| is, or a 0 if they are equal.
2.1.1 Inputs
The integers X and Y are in locations x3120 and x3121, respectively:
x3120: X
x3121: Y
2.1.2 Outputs
The outputs at their corresponding locations are as follows:
x3122: X - Y
x3123: |X|
x3124: |Y|
x3125: Z
where Z is defined as:
if |X| > |Y|: Z = 1
if |X| < |Y|: Z = 2
if |X| = |Y|: Z = 0
(2.1)