Question

The following code calculates A = (4 * B) + C in which A, B, and...

The following code calculates A = (4 * B) + C in which A, B, and C are signed bytes. If C has the decimal value of +28, then what is the largest decimal value for B that allows the code to correctly calculate A = (4 * B) + C as a signed byte?

mov al, [B] ; B

add al, [B] ; 2 * B

add al, al ; 4 * B

add al, [C] ; (4 * B) + C

move [A], al ; A = (4 * B) + C

A) +15 B) +19 C) +24 D) +28 E) +31

Could someone please explain this problem to me as they provide the solution? Thank you.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A = (4 * B) + C

First signed byte range from -128 to 127.
so whatever the value of A it should be be in that range.

so let's put all the values B and find the result.

A) A = (4 * 15) + 28 = 88
B) A = (4 * 19) + 28 = 104
C) A = (4 * 24) + 28 = 124
D) A = (4 * 28) + 28 = 140
E) A = (4 * 31) + 28 = 152

D,E are above the range of signed byte
B,A are below the range and the C
C is the largest possible value for a signed byte. so answer is C (B = 24).
The value for C is 28.

Add a comment
Know the answer?
Add Answer to:
The following code calculates A = (4 * B) + C in which A, B, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT