Question: (b) Multiplication is more difficult when neither argument is known at compile time. The general procedure for achieving multiplication of two unsigned numbers is to

 (b) Multiplication is more difficult when neither argument is known at

(b) Multiplication is more difficult when neither argument is known at compile time. The general procedure for achieving multiplication of two unsigned numbers is to use a series of shift and add operations (think about how long-hand multiplication works). The following assembly code multiplies two unsigned numbers, Sa0 and Sal, leaving the result in SvO. Assume that the result is sufficiently small that it fits in a single register Fill in the missing lines add $v0, ?zero, $zero beq ?a1, $zero, done andi $t0, ?al, 1 beq $to, Szero, skip clear $v0 # if $a!--0, we are done # check bottom bit of $a! # if it is 0, skip over # the next instruction # fill me in! # shift $al to the right # fill me in! # repeat loop: skip: srl ?al, $al,1 j loop done: jr ?ra (b) Multiplication is more difficult when neither argument is known at compile time. The general procedure for achieving multiplication of two unsigned numbers is to use a series of shift and add operations (think about how long-hand multiplication works). The following assembly code multiplies two unsigned numbers, Sa0 and Sal, leaving the result in SvO. Assume that the result is sufficiently small that it fits in a single register Fill in the missing lines add $v0, ?zero, $zero beq ?a1, $zero, done andi $t0, ?al, 1 beq $to, Szero, skip clear $v0 # if $a!--0, we are done # check bottom bit of $a! # if it is 0, skip over # the next instruction # fill me in! # shift $al to the right # fill me in! # repeat loop: skip: srl ?al, $al,1 j loop done: jr ?ra

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!