6 Consider the following set of assembly instructions:
addl %ecx, %edx;
cmpl %ebx, %edx;
jge .L4
where %ecx stores the value C, %ebx the value B and %edx the value D. What C comparison is implemented by this assembly code?
Select one:

a. if (c + d >= b) then { … } else { .L4 }
b. if (c + d > b) then { … } else { .L4 }
c. if (c + d < b) then { … } else { .L4 }
d. None of these.

i think the answer id d.

Recommended Answers

I think you are correct. The assembly code as written is doing basically this:

d += c;
if (d >= b) then goto .L4;

So, to quote Richard Pryor in Brewster's Millions, the answer is "Vote for None of the Above"... :-)

Jump to Post

All 2 Replies

I think you are correct. The assembly code as written is doing basically this:

d += c;
if (d >= b) then goto .L4;

So, to quote Richard Pryor in Brewster's Millions, the answer is "Vote for None of the Above"... :-)

@rubberman: While your answer is strictly correct, I suspect that the professor who gave this question was being idiomatic (or perhaps merely idiotic) and not expecting the students to be quite so literal about it, in which case C) would be the expected (if subtly wrong) answer. Of course, it hardly matters now, since the quiz that the OP was trying to cheat on had been over before you answered the question, anyway.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.