Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Let the value of the register %edi be x, and let k be a positive integer constant. The goal for both parts is to implement %eax k x, but by using...

Let the value of the register %edi be x, and let k be a positive integer constant. The goal for both parts is to implement %eax ← k · x, but by using instructions that run faster than imul $k, %edi. For each k, write the instruction or pair of instructions that yields k · x.

(a)Using a single leal instruction, what values of k are possible? Note: The scaling factor s may only be 1, 2, 4, or 8.

(b) Find a pair of leal instructions, to be executed one after the other, that has the effect of %eax ← k · x, for • k = 45; • k = 41.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question