Question: Write in ARM assembly language Write a shift, test and restore division algorithm (See Binary Division.pdf for details). For i = 1 to 32 do

Write in ARM assembly language

Write a "shift, test and restore" division algorithm (See "Binary Division.pdf" for details).

For i = 1 to 32 do { we're using 32-bit representations }

{

Left Shift the RQ pair

Subtract the Divisor from R

If R is positive then

Set the low order (right most) bit in Q to 1

Else

Restore R by Adding back the Divisor

}

R0 = remainder (R)

R1 = divident/quotient (Q)

R2 = divisor (D)

R1,R0 = R1/R2

Do not use UDIV and SDIV ARM commands!

Your code have to work with any valid numbers in R0. You may use any other register(s). Check your

code with given values first. Then try some another numbers in R1 and R2.

MOVW R1, #163 163/10 = 16, 3

MOVW R2, #10

-- Put your instructions here ---

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!