How convert this pseudocode to LEGv8 ARM code? Assume g and h are in registers X19, and X20 respectively: if (g < h)     g=g+ h; else     h = h * 2 Many books use SUB operator, can I use just CMP to compare g and h?  Please, provide detailed explanation of each line in LEGv8

A+ Guide to Hardware (Standalone Book) (MindTap Course List)
9th Edition
ISBN:9781305266452
Author:Jean Andrews
Publisher:Jean Andrews
Chapter4: Supporting Processors And Upgrading Memory
Section: Chapter Questions
Problem 7RB
icon
Related questions
Topic Video
Question

How convert this pseudocode to LEGv8 ARM code? Assume g and h are in registers
X19, and X20 respectively:


if (g < h)
    g=g+ h;
else
    h = h * 2

Many books use SUB operator, can I use just CMP to compare g and h?  Please, provide detailed explanation of each line in LEGv8

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Instruction Format
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
A+ Guide to Hardware (Standalone Book) (MindTap C…
A+ Guide to Hardware (Standalone Book) (MindTap C…
Computer Science
ISBN:
9781305266452
Author:
Jean Andrews
Publisher:
Cengage Learning