Commit | Line | Data |
---|---|---|
7c27088c KB |
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 | * @(#)Acvtlb.c 7.1 (Berkeley) %G% | |
11 | */ | |
bdf4b0cd | 12 | |
6499767c | 13 | #include "align.h" |
bdf4b0cd SL |
14 | cvtlb(infop) process_info *infop; |
15 | /* | |
16 | /* Convert long to byte, checks overflow | |
17 | /* | |
18 | /****************************************/ | |
19 | { | |
20 | register long result; | |
21 | ||
22 | result = operand(infop,0)->data; | |
23 | if (result < 0 ) negative_1 ; else negative_0; | |
24 | if (result == 0 ) zero_1 ; else zero_0; | |
25 | carry_1; | |
26 | if (result > 0x7f || result <= -0x80) overflow_1; | |
27 | else overflow_0; | |
28 | write_back (infop, result, operand(infop,1) ); | |
29 | } |