What does DIV write for integer division by zero?
It writes all ones to rd, which is -1 under signed interpretation.
Signed division: rs1 / rs2, quotient stored in rd (round toward zero)
DIV is M-extension XLEN-bit signed integer division: rs1 is the dividend, rs2 is the divisor, and the quotient is rounded toward zero and written to rd. With a zero divisor the quotient is all ones (-1); signed overflow occurs only for the most-negative integer divided by -1, where the quotient equals the dividend.
Starts with machine-code field decoding, then shows operand reads, instruction-specific execution, and ISA-visible state update.
This selector chooses only specification-defined division-result branches; it is not an exception, trap, or performance model.
The machine code is split by the current instruction format; the animation starts from encoding/decode.
This animation shows ISA-visible decode and state changes, not any specific CPU pipeline, cache, prediction, or timing implementation.
DIV uses the M-extension R-type encoding for signed XLEN division rounded toward zero; both division by zero and most-negative divided by -1 have specification-defined quotients.
Understand this scenario with real code like «div a0, a1, a2 # a0 = signed(a1 / a2), toward zero».
It writes all ones to rd, which is -1 under signed interpretation.
No. The specification defines signed DIV quotient rounding toward zero.