Question: 3 . Consider the following assembly - language program. Starting values: ( mathrm { R } 2 0 = 4 0 ,

3. Consider the following assembly-language program.
Starting values: \(\mathrm{R}20=40,\mathrm{R}21=50,[\$ 300]=30,[\$ 301]=20\)
(Hint: [\$300] means "contents of memory location \$300".)
```
LDS R20, $300
LDS R21, $301
SUB R20, R21
BRLO X1
STS $301, R21
JMP DONE
X1: STS $300, R21
DONE:RJMP DONE ; Infinite loop - stop here
```
Consider the conditional branch "BRLO".
a. What does BRLO mean?
b. Is BRLO for signed or unsigned numbers?
c. Which instruction determines if the BRLO branch is taken or not? That is, which instruction sets the SREG bits that the BRLO uses to determine whether to branch?
d. Given the starting values shown above, would the result be different if BRSH were used instead of BRLO? Explain why or why not.
e. Using the registers R20 and R21, explain what relationship R20 and R21 must have for the branch to be taken. For example, is the branch taken if R20= R21?
f. What values are in R20, R21, memory location \(\$ 300\), and memory location \(\$ 301\) when the program finishes?
3 . Consider the following assembly - language

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!