xref: /csrg-svn/sys/tahoe/align/Acvtlb.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  *	@(#)Acvtlb.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229602Ssam 
1345699Sbostic #include "align.h"
cvtlb(infop)1429602Ssam cvtlb(infop) 	process_info *infop;
1529602Ssam /*
1629602Ssam /*	Convert long to byte, checks overflow
1729602Ssam /*
1829602Ssam /****************************************/
1929602Ssam {
2029602Ssam 	register long result;
2129602Ssam 
2229602Ssam 	result = operand(infop,0)->data;
2329602Ssam 	if (result < 0 )  negative_1 ; else negative_0;
2429602Ssam 	if (result == 0 )  zero_1 ; else zero_0;
2529602Ssam 	carry_1;
2629602Ssam 	if (result > 0x7f || result <= -0x80) overflow_1;
2729602Ssam 	else overflow_0;
2829602Ssam 	write_back (infop, result, operand(infop,1) );
2929602Ssam }
30