|
|
1.1 root 1: #
2: # Copyright (c) 1979 Regents of the University of California
3: #
4: # char sccsid[] = "@(#)25set.s 4.1 10/10/80";
5: #
6: # SET OPERATIONS
7: #
8: _ADDT:
9: cvtbl (r10)+,r0
10: bneq l2501
11: movzwl (r10)+,r0
12: l2501:
13: addl3 sp,r0,r1 #r1 has pointer to second set
14: ashl $-2,r0,r4 #r4 has number of longs in set
15: l2503:
16: bisl2 (sp)+,(r1)+
17: sobgtr r4,l2503
18: jmp (r8)
19: _SUBT:
20: cvtbl (r10)+,r0
21: bneq l2504
22: movzwl (r10)+,r0
23: l2504:
24: addl3 sp,r0,r1 #r1 has pointer to second set
25: ashl $-2,r0,r4 #r4 has number of longs in set
26: l2506:
27: bicl2 (sp)+,(r1)+
28: sobgtr r4,l2506
29: jmp (r8)
30: _MULT:
31: cvtbl (r10)+,r0
32: bneq l2507
33: movzwl (r10)+,r0
34: l2507:
35: addl3 sp,r0,r1 #r1 has pointer to second set
36: ashl $-2,r0,r4 #r4 has number of longs in set
37: l2509:
38: mcoml (sp)+,r3
39: bicl2 r3,(r1)+
40: sobgtr r4,l2509
41: jmp (r8)
42: _CARD:
43: cvtbl (r10)+,r0 #r0 has number of bytes in set
44: bneq l2510
45: movzwl (r10)+,r0
46: l2510:
47: blbc r0,l2511
48: incl r0
49: l2511:
50: cmpl r0,$2 #check for long align
51: bneq l2525
52: addl2 $2,r0 #if so append it
53: l2525:
54: addl3 r0,sp,r4 #r4 has new stack addr
55: ashl $3,r0,r0 #r0 has number of bits in set
56: mnegl $1,r1 #will init r1 to zero
57: mnegl $1,r5 #will init r2 to zero
58: l2512:
59: incl r1 #count found element
60: incl r5 #advance to next field position
61: l2521:
62: ffs r5,$32,(sp),r5 #find next set bit
63: beql l2521 #nothing found, so continue
64: cmpl r5,r0 #check for end of field
65: blss l2512 #element found, so count and continue
66: movl r4,sp #clear stack
67: movw r1,-(sp) #put answer on stack
68: jmp (r8)
69: _CTTOT:
70: cvtbl (r10)+,r0
71: bneq l2513
72: movzwl (r10)+,r0
73: l2513:
74: pushal -4(sp)[r0]
75: calls r0,_cttot
76: jmp (r8)
77: _IN:
78: cvtbl (r10)+,r0
79: bneq l2514
80: movzwl (r10)+,r0 #r0 has size of set
81: l2514:
82: movl (sp)+,r1 #r1 has set index
83: addl3 r0,sp,r4 #r4 points to new top of stack
84: subw2 (r10)+,r1 #check below lower
85: blssu l2516
86: cmpw r1,(r10)+ #check above upper
87: bgtru l2517
88: bbc r1,(sp),l2517 #check for bit set
89: movl r4,sp #bit found
90: movw $1,-(sp)
91: jmp (r8)
92: l2516:
93: addl2 $2,r10
94: l2517:
95: movl r4,sp #bit not found
96: clrw -(sp)
97: jmp (r8)
98: _INCT:
99: cvtbl (r10)+,r0
100: bneq l2518
101: movzwl (r10)+,r0 #r0 has number of elements
102: l2518:
103: calls r0,_inct
104: movw r0,-(sp)
105: jmp (r8)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.