Update chapter-05 exercise 44 #19
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You forgot about PC incremented in both cases when was evaluating branch offset. And in part a. you also forgot that x3040 and x3080 are hexadecimal. For example x3040 = 0011 0000 0100 0000, so you should add decimal 62 to x3002 (x3001 +1 PC incremented) rather than 38. The same with x3080. In part b. you jump to x3001 from the x3002, rather than to x3000 due to PC incremented in x3002 (x3003 #- 2 = x3001). So R0 won't be set to zero again and loop won't be infinite.