跳至主要內容
Knowledgebase
Home
Renesas Electronics Taiwan - Knowledgebase

Can you explain the quotient and remainder value in DIV instruction?

Latest Updated:06/06/2007

Question:

(CPU)  What happens to the quotient value and remainder value in the division instruction (DIV instruction) in the following cases:
1. the quotient overflows
2. the divisor is 0
3. the dividend is 0 and the divisor is an integer
[2007/06/06]

Answer:

  1. The quotient value and reminder value are indeterminate.
    Before executing the instruction, prevent quotient overflow at the program level.
  2. The quotient value and remainder value are indeterminate.
    Before executing the instruction, prevent the divisor from becoming 0 at the program level.
  3. The quotient value is 0 and the remainder value is FFh with the 1's complement of the remainder 0.

(#104906)

Suitable Products
3803H
3803L
3823
3850A
3858
38D2
38D5
7544
7545
7546
7547
7548
7549