Question: The following LC - 3 program compares two characters strings of the same length. The source strings are in the . STRINGZ form. The first
The following LC program compares two characters strings of the same length. The source strings are
in the STRINGZ form. The first string starts at memory location x and the second string starts
at memory location x If the strings are the same, the program terminates with the value in R
Insert instructions at and that will complete the program. Note: there may be multiple
possible solutions. You only need to provide one of them.
ORIG x
LD R FIRST
LD R SECOND
AND R R #
LOOP
LDR R R #
BRz NEXT
ADD R R #
ADD R R #
ADD R R R
BRz LOOP
AND R R #
BRnzp DONE
NEXT AND R R #
ADD R R #
DONE TRAP x
FIRST FILL x
SECOND FILL x
END
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
