TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: DENNIS LEE BIEBER
date: 2018-04-23 10:15:00
subject: Re: Apologies where they

On Mon, 23 Apr 2018 11:56:51 +0100, The Natural Philosopher
 declaimed the following:

>
>I didnt realise ARM has no div instruction
>

 It has them (at least ARMv8) but some of the behavior may require use
of a subroutine to be rigorous.

"""
The integer divide instructions compute (numerator÷denominator) and deliver
the quotient, which is rounded towards zero. The remainder may then be
computed as numerator–(quotient
denominator) using the MSUB instruction.

If a signed integer division (INT_MIN ÷ -1) is performed, where INT_MIN is
the most negative integer value representable in the selected register
size, then the result will overflow the signed integer range. No indication
of this overflow is produced and the result written to the destination
register will be INT_MIN.

NOTE: The divide instructions do not generate a trap upon division by zero,
but write zero to the destination register.
"""

 At the very least, many higher level languages expect division by zero
to raise a condition -- so a subroutine would likely be used incorporating
the needed testing and flag setting rather than emitting the same common
code every time a divide was done.


--
 Wulfraed                 Dennis Lee Bieber         AF6VN
 wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.