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 bit number by bit number
We follow repetitive subtraction method to divide two numbers.
AREA RESET, DATA, READONLY
P a g e
ESLAB MANUAL
LAB : Code Conversion Programs
EXPORT Vectors
Vectors
DCD ; stack pointer value when stack is empty
DCD ResetHandler ; reset vector
ALIGN
AREA mycode, CODE, READONLY
ENTRY
EXPORT ResetHandler
ResetHandler
MOV R#
LDR ROVALUE; pointer to the first value
LDR RR ; load the first value into
LDR ROVALUE ; pointer to the second value
LDR RR ;load second number into r
up SUB R R ;Subtract two numbers
ADD R# ;increment a counter
CMP RR ; compare two numbers
BCS up ;check Ris greater than R or not, if yes loop
LDR RRESULT ;Quotient
STR RR#
STR RR ;Store remainder.
STOP
B STOP
VALUE DCD times ; ;First bit number
VALUE DCD ;Second bit number
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
