source: trunk/minix/lib/ack/libp/bts.e@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.2 KB
Line 
1#
2; $Header: /cvsup/minix/src/lib/ack/libp/bts.e,v 1.1 2005/10/10 15:27:46 beng Exp $
3;
4; (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
5;
6; This product is part of the Amsterdam Compiler Kit.
7;
8; Permission to use, sell, duplicate or disclose this software must be
9; obtained in writing. Requests for such permissions may be sent to
10;
11; Dr. Andrew S. Tanenbaum
12; Wiskundig Seminarium
13; Vrije Universiteit
14; Postbox 7161
15; 1007 MC Amsterdam
16; The Netherlands
17;
18;
19
20; Author: J.W. Stevenson */
21
22 mes 2,_EM_WSIZE,_EM_PSIZE
23
24#define SIZE 0
25#define HIGH _EM_WSIZE
26#define LOWB 2*_EM_WSIZE
27#define BASE 3*_EM_WSIZE
28
29; _bts is called with four parameters:
30; - the initial set (BASE)
31; - low bound of range of bits (LOWB)
32; - high bound of range of bits (HIGH)
33; - set size in bytes (SIZE)
34
35 exp $_bts
36 pro $_bts,0
37 lal BASE ; address of initial set
38 lol SIZE
39 los _EM_WSIZE ; load initial set
401
41 lol LOWB ; low bound
42 lol HIGH ; high bound
43 bgt *2 ; while low <= high
44 lol LOWB
45 lol SIZE
46 set ? ; create [low]
47 lol SIZE
48 ior ? ; merge with initial set
49 inl LOWB ; increment low bound
50 bra *1 ; loop back
512
52 lal BASE
53 lol SIZE
54 sts _EM_WSIZE ; store result over initial set
55 ret 0
56 end ?
Note: See TracBrowser for help on using the repository browser.