1 /*- 2 * Copyright (c) 1986 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Computer Consoles Inc. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)Acvtlw.c 7.1 (Berkeley) 12/06/90 11 */ 12 13 #include "align.h" 14 cvtlw(infop) 15 process_info *infop; 16 /* 17 /* Convert longword to word 18 /* 19 /****************************************/ 20 { 21 register long result; 22 23 result = operand(infop,0)->data; 24 if (result < 0 ) negative_1 ; else negative_0; 25 if (result == 0 ) zero_1 ; else zero_0; 26 carry_1; 27 if (result > 0x7fff || result <= -0x8000) overflow_1; 28 else overflow_0; 29 write_back (infop, result, operand(infop,1) ); 30 } 31