Question: Question: Write a program to divide a 3 2 bit number by 1 6 bit number We follow repetitive subtraction method to divide two numbers.

Question: Write a program to divide a 32 bit number by 16 bit number
We follow repetitive subtraction method to divide two numbers.
AREA RESET, DATA, READONLY
13| P a g e
ESLAB MANUAL
LAB 4: Code Conversion Programs
EXPORT _ Vectors
Vectors
DCD 040001000; stack pointer value when stack is empty
DCD Reset_Handler ; reset vector
ALIGN
AREA mycode, CODE, READONLY
ENTRY
EXPORT Reset_Handler
Reset_Handler
MOV R2,#00
LDR RO,=VALUE1,; pointer to the first value 1
LDR R1,[R0] ; load the first value into r1
LDR RO,=VALUE2 ; pointer to the second value
LDR R3,[R0] ;load second number into r3
up SUB R1, R3 ;Subtract two numbers
ADD R2,#01 ;increment a counter
CMP R1,R3 ; compare two numbers
BCS up ;check R1is greater than R3 or not, if yes loop
LDR R6,=RESULT ;Quotient
STR R2,[R6,#4]
STR R1,[R6] ;Store remainder.
STOP
B STOP
VALUE1 DCD 0\times 200000000; ;First 32 bit number
VALUE2 DCD 000050000;Second 16 bit number
Question: Write a program to divide a 3 2 bit

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 Finance Questions!