annotate level1/modules/kernelp2.asm @ 27:4dfcc95c371b

Added the COCO basic09 also
author roug
date Sat, 06 Apr 2002 15:05:31 +0000
parents 6641a883d6b0
children 668388823050
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * OS9p2 - OS-9 Level One V2 P2 module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * 10 Tandy/Microware original version
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 nam OS9p2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 ttl OS-9 Level One V2 P2 module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 tylg set Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 rev set $01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 edition set $0A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 name fcs /OS9p2/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 SvcTbl fcb $7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 fdb IOCall-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 fcb F$Unlink
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 fdb FUnlink-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 fcb F$Wait
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 fdb FWait-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 fcb F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 fdb FExit-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 fcb F$Mem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 fdb FMem-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 fcb F$Send
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 fdb FSend-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 fcb F$Sleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 fdb FSleep-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 fcb F$Icpt
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 fdb FIcpt-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 fcb F$ID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 fdb FID-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 fcb F$SPrior
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 fdb FSPrior-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 fcb F$SSwi
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 fdb FSSwi-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 fcb F$STime
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 fdb FSTime-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 fcb F$Find64+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 fdb FFind64-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 fcb F$All64+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 fdb FAll64-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 fcb F$Ret64+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 fdb FRet64-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 fcb $80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 start equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 * install system calls
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 leay SvcTbl,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 os9 F$SSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 ldx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 os9 F$All64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 bcs L0081
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 stx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 sty <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 tfr s,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 ldb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 std $07,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 lda #$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 sta $0D,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 ldu <D.Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 bsr ChdDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 bcc L006A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 lbsr JmpBoot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 bsr ChdDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 L006A bsr OpenCons
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 bcc L0073
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 lbsr JmpBoot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 bsr OpenCons
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 L0073 ldd InitStr,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 leax d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 lda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 ldy #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 os9 F$Chain
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 L0081 jmp [<$FFFE]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 * U = address of init module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 ChdDir clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 ldd <$10,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 beq ChdDir10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 leax d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 lda #READ.+EXEC.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 os9 I$ChgDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 ChdDir10 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 * open console device
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 * U = address of init module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 OpenCons clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 ldd <StdStr,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 leax d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 lda #UPDAT.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 os9 I$Open
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 bcs OpenCn10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 sta P$Path+0,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 os9 I$Dup
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 sta P$Path+1,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 os9 I$Dup
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 sta P$Path+2,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 OpenCn10 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 FUnlink ldd R$U,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 beq L00F9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 ldx <D.ModDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 L00B8 cmpd ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 beq L00C5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 leax $04,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 cmpx <D.ModDir+2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 bcs L00B8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 bra L00F9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 L00C5 lda $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 beq L00CE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 sta $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 bne L00F9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 L00CE ldy ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 cmpy <D.BTLO
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 bcc L00F9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 ldb $06,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 cmpb #$D0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 bcs L00E5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 os9 F$IODel
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 bcc L00E5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 inc $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 bra L00FA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 L00E5 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 std ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 std ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 ldd $02,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 lbsr L0236
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 exg d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 ldx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 os9 F$DelBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 L00F9 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 L00FA rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 FWait ldy <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 ldx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 lda P$CID,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 bne L0108
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 ldb #E$NoChld
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 L0108 os9 F$Find64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 lda P$State,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 bita #Dead dead?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 bne L0124 branch if so
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 lda P$SID,y siblings?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 bne L0108 branch if so
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 clr R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 orcc #FIRQMask+IRQMask
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 ldd <D.WProcQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 std P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 stx <D.WProcQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 lbra L034D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 L0124 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 L0126 lda P$ID,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 ldb <P$Signal,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 std R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 pshs u,y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 leay P$PID,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 ldx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 bra L0138
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 L0135 os9 F$Find64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 L0138 lda P$SID,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 cmpa ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202 bne L0135
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203 ldu $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 ldb $02,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 stb $02,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 os9 F$Ret64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 puls pc,u,y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 FExit ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 ldb R$B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 stb P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 ldb #NumPaths
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 leay P$PATH,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 L0155 lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 beq L0160
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 os9 I$Close
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 puls b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 L0160 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 bne L0155
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 lda P$ADDR,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 tfr d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 lda P$PagCnt,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 ldu P$PModul,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226 os9 F$UnLink
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 ldu <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 leay P$PID,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 ldx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 bra L018C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 L017A clr $02,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 os9 F$Find64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 lda P$State,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 bita #Dead dead?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 beq L018A branch if not
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 lda ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 os9 F$Ret64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 L018A clr P$PID,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 L018C lda P$SID,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 bne L017A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 ldx #$0041
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 lda P$PID,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243 bne L01A4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 ldx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 lda P$ID,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246 os9 F$Ret64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247 bra L01C2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 L01A0 cmpa ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 beq L01B2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250 L01A4 leay ,x Y = proc desc ptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 ldx P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 bne L01A0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 lda P$State,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254 ora #Dead
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 sta P$State,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 bra L01C2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 L01B2 ldd P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
258 std P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 os9 F$AProc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 leay ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 ldu P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 ldu $01,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 lbsr L0126
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 L01C2 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 std <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269 FMem ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 ldd R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 beq L0227
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 bsr L0236
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273 subb P$PagCnt,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 beq L0227
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 bcs L0207
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 ldx P$ADDR,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 pshs u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
279 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280 beq L01E1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 addb $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 L01E1 ldx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
283 ldu <D.FMBM+2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284 os9 F$SchBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 bcs L0231
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 stb $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
288 beq L01F6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
289 addb $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
290 cmpb $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 bne L0231
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292 L01F6 ldb $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 os9 F$AllBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 ldd $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 suba $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 addb $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
297 puls u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
298 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 bra L0225
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 L0207 negb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 negb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
304 addb $08,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
305 addb $07,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
306 cmpb $04,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
307 bhi L0217
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309 ldb #E$DelSP
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
310 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
312 L0217 ldx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
313 os9 F$DelBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
314 tfr y,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
315 negb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
316 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 addb P$PagCnt,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
318 lda P$ADDR,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
319 L0225 std P$ADDR,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320 L0227 lda P$PagCnt,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
321 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
322 std $01,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 adda P$ADDR,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
324 std $06,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
325 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326 L0231 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 ldb #E$MemFul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328 puls pc,u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
329
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
330 L0236 addd #$00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
331 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
332 exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
333 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
334
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
335 FSend lda R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
336 bne L024F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
337 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
338 L0242 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
339 cmpa P$ID,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
340 beq L024A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
341 bsr L024F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 L024A inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
343 bne L0242
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
344 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 L024F ldx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 os9 F$Find64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
349 bcc L025E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
350 ldb #E$IPrcID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
351 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
352
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
353 L0259 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
354 ldb #E$IPrcID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
355 puls pc,y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
356
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
357 L025E pshs y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
358 ldb P$SID,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
359 bne L0275
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
360 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
361 ldd P$User,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
362 beq L026F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
363 cmpd $09,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
364 bne L0259
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
365 L026F lda $0D,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
366 ora #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
367 sta $0D,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
368 L0275 orcc #FIRQMask+IRQMask
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
369 lda <P$Signal,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
370 beq L0284
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
371 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
372 beq L0284
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
373 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
374 ldb #E$USigP
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
375 puls pc,y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
376
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
377 L0284 ldb P$SID,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
378 stb <P$Signal,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
379 ldx #$0043
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
380 bra L02B4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
381 L028E cmpx $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
382 bne L02B4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
383 lda $0D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
384 bita #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
385 beq L02C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
386 ldu $04,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
387 ldd $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
388 beq L02C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389 ldu $0E,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
390 beq L02C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
391 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
392 lda $0D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
393 bita #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
394 puls b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
395 beq L02C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
396 ldu $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
397 addd $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
398 std $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
399 bra L02C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
400 L02B4 leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
401 ldx P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
402 bne L028E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
403 ldx #$0041
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
404 L02BD leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
405 ldx P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
406 beq L02D7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
407 cmpx $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
408 bne L02BD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
409 L02C7 ldd P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
410 std P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
411 lda <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
412 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
413 bne L02D4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
414 sta <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
415 L02D4 os9 F$AProc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
416 L02D7 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
417 puls pc,y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
418
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
419 * F$Sleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
420 FSleep ldx <D.Proc get pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
421 orcc #FIRQMask+IRQMask mask ints
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
422 lda P$Signal,x get proc signal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
423 beq L02EE branch if none
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
424 deca dec signal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
425 bne L02E9 branch if not S$Wake
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
426 sta P$Signal,x clear signal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
427 L02E9 os9 F$AProc insert into activeq
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
428 bra L034D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
429 L02EE ldd R$X,u get timeout
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
430 beq L033A branch if forever
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
431 subd #$0001 subtract 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
432 std R$X,u save back to caller
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
433 beq L02E9 branch if give up tslice
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
434 pshs u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
435 ldx #$0043
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
436 L02FE leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
437 ldx P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
438 beq L0316
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
439 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
440 lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
441 bita #TimSleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
442 puls b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
443 beq L0316
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
444 ldu P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
445 subd $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
446 bcc L02FE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
447 addd $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
448 L0316 puls u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
449 std R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
450 ldd P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
451 stx P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
452 std P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
453 lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
454 ora #TimSleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
455 sta P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
456 ldx P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
457 beq L034D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
458 lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
459 bita #TimSleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
460 beq L034D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
461 ldx P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
462 ldd P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463 subd R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
464 std P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
465 bra L034D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
466 L033A lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
467 anda #^TimSleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
468 sta P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
469 ldd #$0043
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
470 L0343 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
471 ldd P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
472 bne L0343
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
473 stx P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
474 std P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
475 L034D leay <L0361,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
476 pshs y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
477 ldy <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
478 ldd P$SP,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
479 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
480 pshs u,y,x,dp,b,a,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
481 sts P$SP,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
482 os9 F$NProc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
483 L0361 std P$SP,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
484 stx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
485 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
486 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
487
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
488 * F$Icpt
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
489 FIcpt ldx <D.Proc get pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
490 ldd R$X,u get addr of icpt rtn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
491 std <P$SigVec,x store in pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
492 ldd R$U,u get data ptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
493 std <P$SigDat,x store in pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
494 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
495 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
496
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
497 * F$SPrior
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
498 FSPrior lda R$A,u get ID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
499 ldx <D.PrcDBT find pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
500 os9 F$Find64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
501 bcs FSPrEx branch if can't find
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
502 ldx <D.Proc get pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
503 ldd P$User,x get user ID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
504 cmpd P$User,y same as dest pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
505 bne FSPrEx branch if not, must be owner
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
506 lda R$B,u else get prior
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
507 sta P$Prior,y and store it in dest pdesc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
508 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
509 FSPrEx comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
510 ldb #E$IPrcID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
511 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
512
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
513 * F$ID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
514 FID ldx <D.Proc get proc desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
515 lda P$ID,x get id
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
516 sta R$A,u put in A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
517 ldd P$User,x get user ID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
518 std R$Y,u store in Y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
519 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
520 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
521
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
522 * F$SSwi
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
523 FSSwi ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
524 leay P$SWI,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
525 ldb R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
526 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
527 cmpb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
528 bcc FSSwiEx
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
529 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
530 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
531 stx b,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
532 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
533 FSSwiEx comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
534 ldb #E$ISWI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
535 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
536
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
537 ClkName fcs /Clock/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
538
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
539 * F$STime
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
540 FSTime ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
541 ldd ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
542 std <D.Year
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
543 ldd 2,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
544 std <D.Day
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
545 ldd 4,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
546 std <D.Min
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
547 lda #Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
548 leax <ClkName,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
549 os9 F$Link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
550 bcs L03D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
551 jmp ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
552 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
553 L03D2 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
554
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
555 * F$Find64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
556 FFind64 lda R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
557 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
558 bsr L03DF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
559 bcs L03DE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
560 sty R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
561 L03DE rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
562
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
563 L03DF pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
564 tsta
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
565 beq L03F3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
566 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
567 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
568 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
569 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
570 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
571 lda a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
572 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
573 beq L03F3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
574 tst ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
575 bne L03F4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
576 L03F3 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
577 L03F4 puls pc,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
578
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
579 * F$All64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
580 FAll64 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
581 bne L0402
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
582 bsr L040C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
583 bcs L040B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
584 stx ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
585 stx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
586 L0402 bsr L0422
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
587 bcs L040B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
588 sta R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
589 sty R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
590 L040B rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
591
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
592 L040C pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
593 ldd #$0100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
594 os9 F$SRqMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
595 leax ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
596 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
597 bcs L0421
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
598 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
599 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
600 L041C sta d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
601 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
602 bne L041C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
603 L0421 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
604
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
605 L0422 pshs u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
606 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
607 L0425 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
608 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
609 lda a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
610 beq L0437
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
611 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
612 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
613 L042F tst d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
614 beq L0439
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
615 addb #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
616 bcc L042F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
617 L0437 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
618 L0439 leay d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
619 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
620 bcc L0464
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
621 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
622 cmpa #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
623 bcs L0425
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
624 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
625 L0445 tst a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
626 beq L0453
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
627 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
628 cmpa #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
629 bcs L0445
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
630 ldb #E$PthFul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
631 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
632 bra L0471
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
633 L0453 pshs x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
634 bsr L040C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
635 bcs L0473
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
636 leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
637 tfr x,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
638 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
639 puls x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
640 stb a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
641 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
642 L0464 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
643 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
644 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
645 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
646 ldb #$3F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
647 L046A clr b,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
648 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
649 bne L046A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
650 sta ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
651 L0471 puls pc,u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
652 L0473 leas 3,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
653 puls pc,u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
654
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
655 * F$Ret64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
656 FRet64 lda R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
657 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
658 pshs u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
659 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
660 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
661 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
662 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
663 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
664 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
665 lda a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
666 beq L04A0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
667 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
668 clr ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
669 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
670 tfr d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
671 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
672 Ret64Lp tst d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
673 bne Ret64Ex
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
674 addb #64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
675 bne Ret64Lp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
676 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
677 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
678 lda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
679 clr a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
680 L04A0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
681 Ret64Ex clr ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
682 puls pc,u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
683
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
684 IOMgr fcs /IOMAN/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
685
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
686 IOCall pshs u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
687 ldu <D.Init get ptr to init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
688 bsr LinkIOM link to IOMan
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
689 bcc JmpIOM jump into him if ok
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
690 bsr JmpBoot try boot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
691 bcs IOCallRt problem booting... return w/ error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
692 bsr LinkIOM ok, NOW link to IOMan
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
693 bcs IOCallRt still a problem...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
694 JmpIOM jsr ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
695 puls u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
696 ldx -2,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
697 jmp ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
698 IOCAllRt puls pc,u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
699
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
700 LinkIOM leax IOMgr,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
701 lda #Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
702 os9 F$Link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
703 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
704
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
705 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
706 * U = address of init module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
707 JmpBoot pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
708 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
709 tst <D.Boot already booted?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
710 bne JmpBtEr yep, return to caller...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
711 inc <D.Boot else set boot flag
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
712 ldd <BootStr,u get pointer to boot str
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
713 beq JmpBtEr if none, return to caller
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
714 leax d,u X = ptr to boot mod name
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
715 lda #Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
716 os9 F$Link link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
717 bcs JmpBtEr return if error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
718 jsr ,y ...else jsr into boot module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
719 * D = size of bootfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
720 * X = address of bootfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
721 bcs JmpBtEr return if error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
722 stx <D.MLIM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
723 stx <D.BTLO
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
724 leau d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
725 stu <D.BTHI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
726 * search through bootfile and validate modules
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
727 ValBoot ldd ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
728 cmpd #M$ID12
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
729 bne ValBoot1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
730 os9 F$VModul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
731 bcs ValBoot1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
732 ldd M$Size,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
733 leax d,x move X to next module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
734 bra ValBoot2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
735 ValBoot1 leax 1,x advance one byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
736 ValBoot2 cmpx <D.BTHI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
737 bcs ValBoot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
738 JmpBtEr puls pc,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
739
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
740 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
741 eom equ *