(Solved):For the following assembly language code, what is the final value stored in R? K := 0 R := 2259 WHILE R 0 BEGIN K := K + 1 R := 2258 K*100 END R := R + 55 View Answer…

 

Question

For the following assembly language code, what is the final value stored in R?

K := 0

R := 2259

WHILE R > 0

BEGIN

K := K + 1

R := 2258 – K*100

END

R := R + 55

 

EXPERT ANSWER

After the given assembly language code finished executing the value or R will be: {eq}13 {/eq}.

The given code can be converted into the following C++ program which outputs {eq}13 {/eq} as the value of R.

Scroll to top