This is just a learning exercise, so the low performance of repeated subtraction is ok, as discussed in comments on the original Stack Overflow question posted before writing this code as discussed in comments on the original Stack Overflow question posted before writing this code.
This is just a learning exercise, so the low performance of repeated subtraction is ok, as discussed in comments on the original Stack Overflow question posted before writing this code.
This is just a learning exercise, so the low performance of repeated subtraction is ok, as discussed in comments on the original Stack Overflow question posted before writing this code.
I am writing a subroutine for unsigned integer division in Assembly. I will call the subroutine DIVU
.
Inputs: R1
will be the dividend. The divisor will be in R0
.
Outputs: The quotient is going to be in RO
and the remained in R1
.
Quotient = 0; while (Dividend >= Divisor) { Dividend = Dividend -= Divisor; Quotient = Quotient ++= 1;} Remainder = Dividend;
This is just a learning exercise, so the low performance of repeated subtraction is ok, as discussed in comments on the original Stack Overflow question posted before writing this code .
I am writing a subroutine for unsigned integer division in Assembly. I will call the subroutine DIVU
. R1
will be the dividend. The divisor will be in R0
. The quotient is going to be in RO
and the remained in R1
.
Quotient = 0; while (Dividend >= Divisor) { Dividend = Dividend - Divisor; Quotient = Quotient + 1;} Remainder = Dividend;
I am writing a subroutine for unsigned integer division in Assembly. I will call the subroutine DIVU
.
Inputs: R1
will be the dividend. The divisor will be in R0
.
Outputs: The quotient is going to be in RO
and the remained in R1
.
Quotient = 0; while (Dividend >= Divisor) { Dividend -= Divisor; Quotient += 1;} Remainder = Dividend;
This is just a learning exercise, so the low performance of repeated subtraction is ok, as discussed in comments on the original Stack Overflow question posted before writing this code .