[comp.lang.asm370] Suppressing fixed point divide exception

CPI027@ibm.southampton.ac.uk (Paul Dadswell) (06/22/89)

I have an application which allows an operator to plot files sent to
them on a plotter. One of the facilities is a command (QUERY) to
estimate how much longer a plot will take. It answers this by issuing
a STCK to get the current time and subtracting the starting time (also
stored by STCK). The subtraction is carried out by shifting both values
12 bits to the right to get microsecs into the LSB. The idea is then to
divide by the number of records plotted so far to get time per record
and multiply by the number of records left to get an estimate of the
time it will take.

Because the number of records is small compared to microsecs, I divide
the time by F'100000' to get it into 1/10 secs before dividing by the
number of records plotted so far. However despite all these efforts I
occaisonally get a fixed point divide exception, which crashes the
application and forces a re-ipl, not a desirable behaviour. Yes - I do
check that the number of records plotted is > 0.

Since the information is only a guess anyway, I would rather get a wrong
answer than crash. Is there some way of ignoring the divide exception
or trapping it which would enable me to give either the wrong answer or
a message along the lines "Cannot estimate time to finish....sorry"

Paul.

PS. The machine it is running on is a 3090 running HPO 5.