No subject

utzoo!decvax!ucbvax!unix-wizards utzoo!decvax!ucbvax!unix-wizards
Thu Sep 3 05:27:14 AEST 1981


>From decvax!duke!reed!ross at Berkeley Thu Sep  3 05:18:55 1981
I guess I agree with mike at BRL about the choice of forum, but:
Here's a pfe I hacked up when I found to my dismay that V7 didn't
have one.  I think the only problem with the V6 version was that
it thought r1 would be OK after the "sys write".  Separate this
form on the dotted lines.
				-Graham Ross
					(duke!reed!ross)
 ..........
 .TH PFE 1
 .SH NAME
pfe \- print floating-point exception
 .SH SYNOPSIS
 .B pfe
 .SH DESCRIPTION
 .I Pfe
examines the floating point exception register and
prints a diagnostic for the last
floating point exception.
 .SH SEE ALSO
signal(2) for a description of SIGFPE.
 .br
"PDP-11 Processor Handbook" for an explanation of the possible errors.
 .SH BUGS
Written in "the ultimate dead language."
Since the diagnostic applies to the last exception
encountered by
 .I anyone,
pfe doesn't always say what you'd like it to.
 ..........
/ pfe(1) - print floating exception

write = 4
exit = 1
stst = 170300^tst

 .text
	stst	r2
	bic	$!016, r2
	mov	strgs(r2), r3
  1:
	movb	(r3)+, out
	beq	1f
	mov	$1, r0
	sys	write; out; 1
	br	1b
  1:
	mov	r2, r0
	sys	exit

 .data
strgs:
	1f
	2f
	3f
	4f
	5f
	6f
	7f
	8f

1:	<No floating error\n\0>
2:	<Op-code error\n\0>
3:	<Divide by zero\n\0>
4:	<Bad float-to-integer conversion\n\0>
5:	<Overflow\n\0>
6:	<Underflow\n\0>
7:	<Undefined (-0)\n\0>
8:	<Maintenance trap\n\0>
 .even

 .bss
out:	.=.+1



More information about the Comp.unix.wizards mailing list