(40 points) Suppose that we want to compare the 2's complement integers in R1 and R2, and save the result in R0.
If R1 is smaller than R2, R0=-1.
If R1 equals to R2, R0=0.
If R1 is larger than R2, R0=+1.
Based on the following flowchart to solve this problem, write the corresponding program by using the LC-3 machine language. Remember to write the halt instruction at the end of your program.
start
R0-1
R3 NOT R2 R3R3+1 R3 R1 + R3
YES
R3<0?
ONT R3=0?
YES
ONI
R0R0 + 1
R0+ R0+1
end