Skip to main content
Code Review

Return to Question

edited tags
Link
200_success
  • 145.5k
  • 22
  • 190
  • 478
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

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 .

Post Reopened by Jamal
deleted 188 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
Loading
added 305 characters in body
Source Link
jason
  • 33
  • 1
  • 6
Loading
added 7 characters in body
Source Link
jason
  • 33
  • 1
  • 6
Loading
Post Closed as "Not suitable for this site" by Jamal
deleted 546 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
Loading
Source Link
jason
  • 33
  • 1
  • 6
Loading
lang-lisp

AltStyle によって変換されたページ (->オリジナル) /