ack/lang/m2/libm2/LtoUset.e

62 lines
1.3 KiB
Plaintext
Raw Normal View History

1987-05-13 14:36:45 +00:00
#
1988-02-19 15:54:01 +00:00
;
; (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
; See the copyright notice in the ACK home directory, in the file "Copyright".
;
;
; Module: Compute non-constant set displays
; Author: Ceriel J.H. Jacobs
; Version: $Header$
;
1987-05-13 14:36:45 +00:00
mes 2,EM_WSIZE,EM_PSIZE
1988-03-23 17:55:57 +00:00
; LtoUset is called for set displays containing { expr1 .. expr2 }.
1987-10-28 16:10:02 +00:00
; It has six parameters, of which the caller must pop five:
1987-05-13 14:36:45 +00:00
; - The set in which bits must be set.
1987-10-28 16:10:02 +00:00
; - the lower bound of the set type.
1987-05-13 14:36:45 +00:00
; - The set size in bytes.
; - The upper bound of set elements, specified by the set-type.
; - "expr2", the upper bound
; - "expr1", the lower bound
1987-10-28 16:10:02 +00:00
#define SETBASE 5*EM_WSIZE
#define SETLOW 4*EM_WSIZE
1987-05-13 14:36:45 +00:00
#define SETSIZE 3*EM_WSIZE
#define USETSIZ 2*EM_WSIZE
#define LWB EM_WSIZE
#define UPB 0
1988-03-23 17:55:57 +00:00
exp $LtoUset
pro $LtoUset,0
1987-05-13 14:36:45 +00:00
lal SETBASE ; address of initial set
lol SETSIZE
los EM_WSIZE ; load initial set
lol LWB ; low bound
1987-10-28 16:10:02 +00:00
lol SETLOW
sbu EM_WSIZE
stl LWB
1987-05-13 14:36:45 +00:00
lol UPB ; high bound
1987-10-28 16:10:02 +00:00
lol SETLOW
sbu EM_WSIZE
stl UPB
1
lol LWB
lol UPB
cmu EM_WSIZE
zgt *2 ; while low <= high
1987-05-13 14:36:45 +00:00
lol LWB
lol SETSIZE
set ? ; create [low]
lol SETSIZE
ior ? ; merge with initial set
1987-10-28 16:10:02 +00:00
lol LWB
loc 1
adu EM_WSIZE
stl LWB
1987-05-13 14:36:45 +00:00
bra *1 ; loop back
2
lal SETBASE
lol SETSIZE
sts EM_WSIZE ; store result over initial set
ret 0
end 0