Sujet : Re: integer divided by zero
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 28. Apr 2025, 16:03:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250428180339.000044a9@yahoo.com>
References : 1 2 3 4 5
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
On Mon, 28 Apr 2025 14:28:41 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
Bonita Montero <Bonita.Montero@gmail.com> writes:
Am 28.04.2025 um 13:15 schrieb Richard Damon:
NO, not all processors have a trap for divide by zero on integers,
and many that do allow the disabling of that trap.
>
Windows requires processors that can trap divisions by zero,
No, Windows only runs on processors (x86) that happen to trap
divisions by zero. Linux runs on hundreds of processors, some of
which do, some of which don't.
Historically, Windows NT family of Windows OSes supported 6 different
architectures (or 8, depending of whether you consider AMD64 and
Aarch64 as different or the same as their 32-bit predecessors).
2 architectures architectures supported in the latest version (Win11).
IIRC, majority of those architectures can trap on integer division
by zero. Exceptions to that are Alpha and Itanium that *do not have*
integer division instructions. Alpha has floating-point division that
traps on zero. Itanium has no division instructions at all.
I'd guess, emulation of trap by compiler is easier in this cases than
in case of processors that do have integer division but do not trap on
zero divisor.
The "other" Windows OS family, now mostly defunct Windows CE, supported
few more architectures. I don't know nearly enough about some of them.