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 example uses fixed initial register values and PC=0x2000; instruction fetch succeeds, with no asynchronous interrupt or extra extension checks. Exception branches stop ordinary commit; post-trap PC and handler state are EEI-dependent.
This selector chooses specification-defined division-result branches. Division presets set the displayed t1/t2 initial values; editing a source register restores normal mode. It is not a 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 # a1=-7, a2=3 -> a0=-2 (round toward zero)».
It writes all ones to rd, which is -1 under signed interpretation.
No. The specification defines signed DIV quotient rounding toward zero.