xref: /original-bsd/sys/tahoe/align/Asub2.c (revision b65ab6e5)
1*b65ab6e5Sbostic /*-
2*b65ab6e5Sbostic  * Copyright (c) 1986 The Regents of the University of California.
3*b65ab6e5Sbostic  * All rights reserved.
4*b65ab6e5Sbostic  *
5*b65ab6e5Sbostic  * This code is derived from software contributed to Berkeley by
6*b65ab6e5Sbostic  * Computer Consoles Inc.
7*b65ab6e5Sbostic  *
8*b65ab6e5Sbostic  * %sccs.include.redist.c%
9*b65ab6e5Sbostic  *
10*b65ab6e5Sbostic  *	@(#)Asub2.c	7.1 (Berkeley) 12/06/90
11*b65ab6e5Sbostic  */
129db31f5aSsam 
13f5878f6dSbostic #include "align.h"
sub2(infop)149db31f5aSsam sub2(infop)	process_info *infop;
159db31f5aSsam /*
169db31f5aSsam /*	Subtract , 2 operands.
179db31f5aSsam /*
189db31f5aSsam /*****************************************/
199db31f5aSsam {
209db31f5aSsam 
219db31f5aSsam 	register	long	Register_12;	/* Has to be first reg ! */
229db31f5aSsam 	register 	long	data0, data1, result;
239db31f5aSsam 
249db31f5aSsam 	data0 = operand(infop,0)->data;
259db31f5aSsam 	data1 = operand(infop,1)->data;
269db31f5aSsam 	Register_12=psl;
279db31f5aSsam 	Set_psl(r12);	/* restore the user psl */
289db31f5aSsam 	result = data1 - data0;		/* 32 bits of true result */
299db31f5aSsam 	asm ("	movpsl	r12");
309db31f5aSsam 	New_cc (Register_12);
319db31f5aSsam 	write_back (infop,result, operand(infop,1) );
329db31f5aSsam }
33