Question: 3 . Consider the following assembly - language program. Starting values: ( mathrm { R } 2 0 = 4 0 ,
Consider the following assemblylanguage program.
Starting values: mathrmRmathrmR$ $
Hint: $ means "contents of memory location $
LDS R $
LDS R $
SUB R R
BRLO X
STS $ R
JMP DONE
X: STS $ R
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 R and R explain what relationship R and R must have for the branch to be taken. For example, is the branch taken if R R
f What values are in R R memory location $ and memory location $ when the program finishes?
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
