xref: /csrg-svn/sys/tahoe/align/Aediv.c (revision 45760)
1*45760Sbostic /*-
2*45760Sbostic  * Copyright (c) 1986 The Regents of the University of California.
3*45760Sbostic  * All rights reserved.
4*45760Sbostic  *
5*45760Sbostic  * This code is derived from software contributed to Berkeley by
6*45760Sbostic  * Computer Consoles Inc.
7*45760Sbostic  *
8*45760Sbostic  * %sccs.include.redist.c%
9*45760Sbostic  *
10*45760Sbostic  *	@(#)Aediv.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229606Ssam 
1345699Sbostic #include "align.h"
1429606Ssam int	zzz1,zzz2,zzz3,zzz4,zzz5;
ediv(infop)1529606Ssam ediv(infop)	process_info *infop;
1629606Ssam /*
1729606Ssam /*	Extended precision division.
1829606Ssam /*
1929606Ssam /***************************************/
2029606Ssam {
2129606Ssam 	register long Register_12;	/* Has to be the first reg !! */
2229606Ssam 	register long Register_11;	/* remainder */
2329606Ssam 	register long Register_10;	/* quotient */
2429606Ssam 	register long Register_9;	/* divident least */
2529606Ssam 	register long Register_8;	/* divident most */
2629606Ssam 	register long Register_7;	/* divisor */
2729606Ssam 
2829606Ssam 	Register_7 = operand(infop, 0)->data;
2929606Ssam 	Register_8 = operand(infop, 1)->data;
3029606Ssam 	Register_9 = operand(infop, 1)->data2;
3129606Ssam 	Register_12=psl;
3229606Ssam 	Set_psl(r12);	/* restore the user psl */
3329606Ssam 	asm ("	ediv	r7,r8,r10,r11");
3429606Ssam 	asm ("	movpsl	r12");
3529606Ssam 	New_cc (Register_12);
3629606Ssam 	write_back (infop, Register_10, operand(infop, 2));
3729606Ssam 	write_back (infop, Register_11, operand(infop, 3));
3829606Ssam }
39