A using a single leal instruction what values of k are


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.

Solution Preview :

Prepared by a verified Expert
Basic Statistics: A using a single leal instruction what values of k are
Reference No:- TGS02626844

Now Priced at $10 (50% Discount)

Recommended (92%)

Rated (4.4/5)