annotate level2/modules/kernel/fgcmdir.asm @ 2118:7fca19b7c923

ChangeLog udpated FSRqMem optimization added
author boisy
date Fri, 24 Aug 2007 03:30:33 +0000
parents 1da8ab9ba433
children 039ddb7c8ad7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
1 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
2 * System Call: F$GCMDir
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
3 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
4 * Notes:
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
5 * This system call is only used by OS9p1 to get rid of all
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
6 * the empty spaces in the module directory to keep it small
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
7 * and compact.
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
8 *
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
9 * Input: X = Address of allocation bitmap
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
10 * D = Number of first bit to set
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
11 * Y = Bit count (number of bits to set)
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
12 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
13 * Output: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
14 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
15 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1145
diff changeset
16 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 FGCMDir ldx <D.ModDir get pointer to module directory start
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18 bra L0C1D skip ahead
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 L0C17 ldu MD$MPDAT,x DAT initialized?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20 beq L0C23 no it's empty skip ahead
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 leax MD$ESize,x move to next entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 L0C1D cmpx <D.ModEnd end of module directory?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
23 bne L0C17 no, keep looking
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 bra L0C4B
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
25 * Move all entrys up 1 slot in directory
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
26 L0C23 tfr x,y move empty entry pointer to Y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
27 bra L0C2B
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
28 L0C27 ldu MD$MPDAT,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 bne L0C34
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
30 L0C2B leay MD$ESize,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
31 cmpy <D.ModEnd done complete directory?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
32 bne L0C27 no, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
33 bra L0C49
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 * Move entry up 1 slot in directory
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
35 L0C34 equ *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
36 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
37 ldw #MD$ESize
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
38 tfm y+,x+
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
39 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
40 ldu ,y++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
41 stu ,x++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
42 ldu ,y++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
43 stu ,x++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
44 ldu ,y++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
45 stu ,x++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
46 ldu ,y++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
47 stu ,x++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
48 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
49 L0C44 cmpy <D.ModEnd done complete directory?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
50 bne L0C27 no, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
51
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
52 L0C49 stx <D.ModEnd save new module directory end pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
53 * Shrink DAT table
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
54 L0C4B ldx <D.ModDir+2 get module directory DAT end pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
55 bra L0C53
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
56
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
57 L0C4F ldu ,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
58 beq L0C5B
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
59 L0C53 leax -2,x Bump module ptr down by 2
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
60 cmpx <D.ModDAT Hit beginning yet?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
61 bne L0C4F No, keep checking
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
62 clrb Yes, return without error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
63 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
64
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
65 L0C5B ldu -2,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
66 bne L0C53
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
67 tfr x,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
68 bra L0C67
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
69
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
70 L0C63 ldu ,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
71 bne L0C70
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
72 L0C67 leay -2,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
73 L0C69 cmpy <D.ModDAT
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
74 bcc L0C63
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
75 bra L0C81
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
76 L0C70 leay 2,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
77 ldu ,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
78 stu ,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
79 L0C76 ldu ,--y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
80 stu ,--x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
81 beq L0C87
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
82 cmpy <D.ModDAT
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
83 bne L0C76
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
84
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
85 L0C81 stx <D.ModDAT
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
86 bsr L0C95
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
87 clrb Yes, return without error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
88 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
89
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
90 L0C87 leay 2,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
91 leax 2,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
92 bsr L0C95
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
93 leay -4,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
94 leax -2,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
95 bra L0C69
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
96
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
97 * Update Module Dir Image Ptrs
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
98 L0C95 pshs u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
99 ldu <D.ModDir
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
100 bra L0CA4
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
101 L0C9B cmpy MD$MPDAT,u same DAT ptrs?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
102 bne L0CA2 no, skip
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
103 stx MD$MPDAT,u else update ptrs
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
104 L0CA2 leau MD$ESize,u next entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
105 L0CA4 cmpu <D.ModEnd last entry?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
106 bne L0C9B no
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
107 puls u,pc else yes... return