xref: /csrg-svn/sys/tahoe/align/Acvtlw.c (revision 45699)
1*45699Sbostic /*	Acvtlw.c	1.2	90/12/04	*/
229603Ssam 
3*45699Sbostic #include "align.h"
429603Ssam cvtlw(infop)
529603Ssam process_info *infop;
629603Ssam /*
729603Ssam /*	Convert longword to word
829603Ssam /*
929603Ssam /****************************************/
1029603Ssam {
1129603Ssam 	register long result;
1229603Ssam 
1329603Ssam 	result = operand(infop,0)->data;
1429603Ssam 	if (result < 0 )  negative_1 ; else negative_0;
1529603Ssam 	if (result == 0 )  zero_1 ; else zero_0;
1629603Ssam 	carry_1;
1729603Ssam 	if (result > 0x7fff || result <= -0x8000) overflow_1;
1829603Ssam 	else overflow_0;
1929603Ssam 	write_back (infop, result, operand(infop,1) );
2029603Ssam }
21