This is an old revision of the document!


The PSX has a few undefined cases when it comes to division. It's important to remeber than undefined isn't the same as inconsistent or unstable, and as a result, there are games out the which relies on this undefined behavior.

Signed division by zero

The result of a division by zero is consistent with the result of a smiple radix-2 (“one bit at a time”) implementation. That is, if the dividend is negative, the quotient is 1 (0x00000001), and if the dividend is positive or zero, the quotient is -1 (0xffffffff). In both cases the remainder equals the dividend.

Unsigned division by zero

In the case of unsigned division, the dividend can't be negative and thus the quotient is always -1 (0xffffffff) and the remainder equals the dividend.

Signed division of most negative by minus one

This is actually quite interesting, not the result of the operation, but the fact that some CPUs (x86 for example) will trigger an arithmetic exception when dividing 0x80000000 by 0xffffffff. Thus you may be able to crash your favourite (x86) PSX emulator by a few lines of MIPS code. The result of the operation is a quotient of 0x80000000 and a remainder of 0x00000000.

Print/export