Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Which selections are the correct implementation of the following pseudocode? ( assume values are unsigned ) if ( val 1 > val 2 | |

Which selections are the correct implementation of the following pseudocode? (assume values are unsigned)
if( val1> val2|| val2> val3)
val4= val1;
else
val4= val3;
a.
ADR R0, val1
LDR R1,[R0]
ADR R0, val2
LDR R2,[R0]
ADR R0, val3
LDR R3,[R0]
ADR R0, val4
CMP R1, R2
BGT L1
CMP R2, R3
BGT L1
STR R3,[R0]
B L2
L1 STR R1,[R0]
L2
b.
ADR R0, val1
LDR R1,[R0]
ADR R0, val2
LDR R2,[R0]
ADR R0, val3
LDR R3,[R0]
ADR R0, val4
CMP R1, R2
BLE L1
CMP R2, R3
BLE L1
STR R1,[R0]
B L2
L1 STR R3,[R0]
L2
c.
ADR R0, val1
LDR R1,[R0]
ADR R0, val2
LDR R2,[R0]
ADR R0, val3
LDR R3,[R0]
ADR R0, val4
CMP R1, R2
BGT L1
CMP R2, R3
BGT L1
STR R1,[R0]
B L2
L1 STR R3,[R0]
L2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions