Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Which selections are the correct implementation of the following pseudocode?
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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions