[9] | 1 | #
|
---|
| 2 | ;
|
---|
| 3 | ; (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
---|
| 4 | ; See the copyright notice in the ACK home directory, in the file "Copyright".
|
---|
| 5 | ;
|
---|
| 6 | ;
|
---|
| 7 | ; Module: Compute non-constant set displays
|
---|
| 8 | ; Author: Ceriel J.H. Jacobs
|
---|
| 9 | ; Version: $Header: /cvsup/minix/src/lib/ack/libm2/LtoUset.e,v 1.1 2005/10/10 15:27:46 beng Exp $
|
---|
| 10 | ;
|
---|
| 11 | mes 2,_EM_WSIZE,_EM_PSIZE
|
---|
| 12 |
|
---|
| 13 | ; LtoUset is called for set displays containing { expr1 .. expr2 }.
|
---|
| 14 | ; It has six parameters, of which the caller must pop five:
|
---|
| 15 | ; - The set in which bits must be set.
|
---|
| 16 | ; - the lower bound of the set type.
|
---|
| 17 | ; - The set size in bytes.
|
---|
| 18 | ; - The upper bound of set elements, specified by the set-type.
|
---|
| 19 | ; - "expr2", the upper bound
|
---|
| 20 | ; - "expr1", the lower bound
|
---|
| 21 |
|
---|
| 22 | #define SETBASE 5*_EM_WSIZE
|
---|
| 23 | #define SETLOW 4*_EM_WSIZE
|
---|
| 24 | #define SETSIZE 3*_EM_WSIZE
|
---|
| 25 | #define USETSIZ 2*_EM_WSIZE
|
---|
| 26 | #define LWB _EM_WSIZE
|
---|
| 27 | #define UPB 0
|
---|
| 28 | exp $LtoUset
|
---|
| 29 | pro $LtoUset,0
|
---|
| 30 | lal SETBASE ; address of initial set
|
---|
| 31 | lol SETSIZE
|
---|
| 32 | los _EM_WSIZE ; load initial set
|
---|
| 33 | lol LWB ; low bound
|
---|
| 34 | lol SETLOW
|
---|
| 35 | sbu _EM_WSIZE
|
---|
| 36 | stl LWB
|
---|
| 37 | lol UPB ; high bound
|
---|
| 38 | lol SETLOW
|
---|
| 39 | sbu _EM_WSIZE
|
---|
| 40 | stl UPB
|
---|
| 41 | 1
|
---|
| 42 | lol LWB
|
---|
| 43 | lol UPB
|
---|
| 44 | cmu _EM_WSIZE
|
---|
| 45 | zgt *2 ; while low <= high
|
---|
| 46 | lol LWB
|
---|
| 47 | lol SETSIZE
|
---|
| 48 | set ? ; create [low]
|
---|
| 49 | lol SETSIZE
|
---|
| 50 | ior ? ; merge with initial set
|
---|
| 51 | lol LWB
|
---|
| 52 | loc 1
|
---|
| 53 | adu _EM_WSIZE
|
---|
| 54 | stl LWB
|
---|
| 55 | bra *1 ; loop back
|
---|
| 56 | 2
|
---|
| 57 | lal SETBASE
|
---|
| 58 | lol SETSIZE
|
---|
| 59 | sts _EM_WSIZE ; store result over initial set
|
---|
| 60 | ret 0
|
---|
| 61 | end 0
|
---|