Where is my mistake? I need to find maximum value among three values that stored in registers X19,X20,X21. After maximum value was found I need to add it to register X24. Please do not use MOV,COMP, do not load values using LDUR or LDR. Code is LEGv8. Here is my code: SUB X25, X19, X20 CBZ X25, l1 SUB X26, X19, X21 CBZ X26, l2 ADD X24, X24, X19 B done l1: SUB X26,X20,X21 CBZ X26, l2 ADD X24, X24, X20 B done l2: ADD X24,X24,X21 done:

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.1: Addresses And Pointers
Problem 2E
icon
Related questions
Question

Where is my mistake? I need to find maximum value among three values that stored in registers X19,X20,X21. After maximum value was found I need to add it to register X24. Please do not use MOV,COMP, do not load values using LDUR or LDR. Code is LEGv8. Here is my code:

SUB X25, X19, X20
CBZ X25, l1
SUB X26, X19, X21
CBZ X26, l2
ADD X24, X24, X19
B done

l1:
SUB X26,X20,X21
CBZ X26, l2
ADD X24, X24, X20
B done

l2:
ADD X24,X24,X21

done:

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Fundamentals of Computer System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr