brk's zero-fill behavior on VAXen (useful undefined checks)

System Mangler mangler at cit-vax.Caltech.Edu
Sat Nov 15 19:28:01 AEST 1986


In article <160 at haddock.UUCP>, karl at haddock.UUCP (Karl Heuer) writes:
> P.S. I like the way VAXen do this with floating point (the result of some
> operation is NaN, which triggers an FPE on the *next* usage, giving the user
> a chance to test for it first).

I inherited an interpreter that uses this trick.  Checking for a NaN was
done by a call-by-reference assembly language routine; when I rewrote it
as a call-by-value C routine, I got floating point exceptions.	Why?  The
MOVD instruction that pushes the value on the stack will raise an FPE if
asked to push a NaN!  You have to be very careful how you look at those...

Don Speck   speck at vlsi.caltech.edu  {seismo,rutgers,ames}!cit-vax!speck



More information about the Comp.unix.wizards mailing list