AminetAminet
Search:
83164 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/boot/NoMoreDiv0.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:No more Division by Zero
Author:Holger.Hippenstiel AT gmx.de
Uploader:Holger Hippenstiel gmx de
Type:util/boot
Version:1.3 (30.07.2020)
Replaces:util/boot/NoMoreDiv0.lha
Architecture:m68k-amigaos >= 2.0.0
Distribution:Aminet
Kurz:Keine Geteilt Durch Null Abstuerze mehr
Date:2020-07-30
Download:http://aminet.net/util/boot/NoMoreDiv0.lha - View contents
Readme:http://aminet.net/util/boot/NoMoreDiv0.readme
Downloads:99
NoMoreDiv0 V1.3
===============

TL;DR Install NoMoreDiv0 in C:, Call in Startup-Sequence after SetPatch or
in User-Startup. Programs wont crash with "Division by Zero" anymore.

   **********************************************************************
   *** Warning - This is a HACK, to make old/buggy programs working ! ***
   ***     No one should develop programs while this is running,      ***
   ***  you should check for division by zero errors in your code !   ***
   **********************************************************************

Because i was working on CopyMemAIO i noticed for example "TestIt" from
CopyMemQuicker crashes with Division by Zero.
The WinUAE-Emulation is so fast that nearly "no time" has passed,
which causes "TestIt" to try to divide by Zero (time).
And i remembered i had similar problems with other programs aswell,
the only solution was to change the speed to "Approximate A500/A1200 or
cycle exact" and +500% - but thats to slow for me. :P

So my idea was to replace the division by zero, if you think about it
smaller divisors means bigger results:
100/5 = 20, 100/2 = 50, 100/1 = 100 and finally 100/0 = Infinite
Ok, you cant calculate the other way: Infite * 0 = 100
But imho it is the best approximation.

This program will exactly do that, patch the Division by Zero Exception
and change the "faulty" register to 0x7ffffff (Maximum positive Value).
In case of div(u/s)l.l with a Register for the Remainder, it will be cleared.

If you start it again, the Patch will be removed and Returncode 5 is given.

*** Update:
Whoops, forgot "div? Addr(pc,dx.z*n),dy" in V1.2.
But due some optimitations it's even 68 bytes smaller than V1.2. :D

Supported Modes are now:

div?l.l LongAddr.l,dy:dz
div?l.l #n,dy:dz
div?l.l Addr.w,dy:dz
div?l.l Addr(pc),dy:dz
div?l.l Addr(pc,dx.z*n),dy:dz
div?l.l off(ax,dx.z*n),dy:dz
div?l.l off(ax),dy:dz
div?l.l dx,dy:dz
div?l.l (ax),dy:dz
div?l.l (ax)+,dy:dz
div?l.l -(ax),dy:dz
div? LongAddr.l,dy
div? #n,dy
div? Addr.w,dy
div? Addr(pc),dy
div? Addr(pc,dx.z*n),dy
div? off(ax,dx.z*n),dy
div? off(ax),dy
div? dx,dy
div? (ax),dy
div? (ax)+,dy
div? -(ax),dy

? = u or s
All div?l.l with or without remainder-register.

*** Known Bugs/Limitations:

Because the code in the exception has to check code -8 from current PC it
could cause enforcer-hits, very unlikely - but it can happen.

Memory Indirect Modes are not supported, no one should use crap like:
div(u/s)(l.l) ([Label1,ax/pc,dx.z*n],Label2),dy:dz
... anyway. :P

    DISCLAIMER

        This software is subject to the "Standard Amiga FD-Software Copyright
        Note". It is FREEWARE as defined in paragraph 4a.  You are allowed to
        use this software FREE. For more information please read
        "AFD-COPYRIGHT".

        Diese Software unterliegt der "Standard Amiga FD-Software Copyright
        Note". Sie ist FREEWARE wie definiert in Absatz 4a.  Du darfst diese
        Software KOSTENLOS benutzen. Fuer mehr Informationen lies bitte
        "AFD-COPYRIGHT".

        (/pub/aminet/docs/misc/AFD-FilesV-XX.lha V=Version,XX=Languages)

    AUTHOR

        Please send comments or bug-reports to:

        Holger.Hippenstiel AT gmx.de

============================= Archive contents =============================

Original  Packed Ratio    Date     Time    Name
-------- ------- ----- --------- --------  -------------
     440     391 11.1% 30-Jul-20 01:34:10  NoMoreDiv0
    3182    1530 51.9% 30-Jul-20 01:34:48  NoMoreDiv0.txt
-------- ------- ----- --------- --------
    3622    1921 46.9% 30-Jul-20 01:35:50   2 files



Contents of util/boot/NoMoreDiv0.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                  391     440  88.9% -lh5- f5f5 Jul 30 01:34 NoMoreDiv0
[unknown]                 1530    3182  48.1% -lh5- f323 Jul 30 01:34 NoMoreDiv0.txt
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         2 files    1921    3622  53.0%            Jul 30 13:52

Aminet © 1992-2020 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>